From 1e6bf2ddfa601cc3f461db8bfeb1601f00c9f1cd Mon Sep 17 00:00:00 2001 From: Sebastien Flory Date: Thu, 23 Jan 2025 17:14:51 +0100 Subject: [PATCH] Add: test.sh script (#10199) --- front/admin/test.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 front/admin/test.sh diff --git a/front/admin/test.sh b/front/admin/test.sh new file mode 100755 index 000000000000..8c836cd0f82f --- /dev/null +++ b/front/admin/test.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# Get the directory where the script is located +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Check that we have TEST_FRONT_DATABASE_URI set +if [ -z "$TEST_FRONT_DATABASE_URI" ]; then + echo "Error: TEST_FRONT_DATABASE_URI is not set" + exit 1 +fi + +# Init the test db +echo "Synching test db schemas..." +NODE_ENV=TEST FRONT_DATABASE_URI=$TEST_FRONT_DATABASE_URI npx tsx "$SCRIPT_DIR/db.ts" + +# Start the tests +FRONT_DATABASE_URI=$TEST_FRONT_DATABASE_URI npm run test