Skip to content

Commit

Permalink
Add: test.sh script (#10199)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraggle authored Jan 23, 2025
1 parent 2dfc190 commit 1e6bf2d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions front/admin/test.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1e6bf2d

Please sign in to comment.