Skip to content

Commit

Permalink
tests: shell script updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jankapunkt committed Jan 5, 2024
1 parent ac2a0df commit 0854d4a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
#!/bin/sh
echo "Placing root files into dummy_app for testing"
mkdir -p tests/dummy_app/packages/meteor-mocha
rsync -av ./package/ tests/dummy_app/packages/meteor-mocha
echo "Setup package link"
cd tests/dummy_app/
# meteor npm install
meteor npm run setup

# We expect all unit tests to pass
meteor npm run test:unit:puppeteer 2> /dev/null
echo "npm run test:unit:puppeteer exited with code $?"
UNIT_TEST_EXIT=$?
echo "npm run test:unit:puppeteer exited with code $UNIT_TEST_EXIT"

if [ $? -ne 0 ]; then
if [ $UNIT_TEST_EXIT -ne 0 ]; then
echo "expected exit code 0, got $UNIT_TEST_EXIT; exit 1"
exit 1 # Our suite fails because tests that should have passed failed
fi

# We expect all app tests to fail
meteor npm run test:app:puppeteer 2> /dev/null
echo "npm run test:app:puppeteer exited with code $?"
APP_TEST_EXIT=$?
echo "npm run test:app:puppeteer exited with code $APP_TEST_EXIT"

if [ $? -ne 1 ]; then
if [ $APP_TEST_EXIT -ne 1 ]; then
echo "expected exit code 1, got $APP_TEST_EXIT; exit 1"
exit 1 # Our suite fails because tests that should have failed passed
fi

echo "all tests passed; exit 0"
exit 0

0 comments on commit 0854d4a

Please sign in to comment.