Re-add TEST_ONLY and use Jest's -t for TEST_GREP. (#7556)

This commit is contained in:
Logan Smyth 2018-03-12 15:12:39 -07:00 committed by GitHub
parent bdd70c37e0
commit 353d3199c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,20 +1,26 @@
#!/bin/bash #!/bin/bash
set -e set -e
if [ -z "$TEST_GREP" ]; then
TEST_GREP=""
fi
node="node" node="node"
jestArgs="" jestArgs=()
if [ "$TEST_DEBUG" ]; then if [ "$TEST_DEBUG" ]; then
node="node --inspect-brk" node="node --inspect-brk"
jestArgs="${jestArgs} --runInBand" jestArgs+=("--runInBand")
fi fi
if [ -n "$CI" ]; then if [ -n "$CI" ]; then
jestArgs="${jestArgs} --maxWorkers=4 --ci" jestArgs+=("--maxWorkers=4")
jestArgs+=("--ci")
fi fi
$node node_modules/.bin/jest $jestArgs "$TEST_GREP" if [ -n "$TEST_GREP" ]; then
jestArgs+=("-t")
jestArgs+=("$TEST_GREP")
fi
if [ -n "$TEST_ONLY" ]; then
jestArgs+=("packages/.*$TEST_ONLY.*/test")
fi
$node node_modules/.bin/jest "${jestArgs[@]}"