Skip to content

Commit 7881651

Browse files
chore: shift only when arguments are passed to the script
1 parent 2236951 commit 7881651

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/accuracy/run-accuracy-tests.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ export MDB_ACCURACY_RUN_ID=$(npx uuid v4)
1414
# By default we run all the tests under tests/accuracy folder unless a path is
1515
# specified in the command line. Such as:
1616
# npm run test:accuracy -- tests/accuracy/some-test.test.ts
17-
TEST_PATH_PATTERN="${1:-tests/accuracy}"
18-
shift || true
17+
if [ $# -gt 0 ]; then
18+
TEST_PATH_PATTERN="$1"
19+
shift
20+
else
21+
TEST_PATH_PATTERN="tests/accuracy"
22+
fi
1923
echo "Running accuracy tests with MDB_ACCURACY_RUN_ID '$MDB_ACCURACY_RUN_ID' and TEST_PATH_PATTERN '$TEST_PATH_PATTERN'"
2024
node --experimental-vm-modules node_modules/jest/bin/jest.js --bail --testPathPatterns "$TEST_PATH_PATTERN" "$@"
2125

0 commit comments

Comments
 (0)