Migrate to jest (#7455)
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
TEST_DIRS=""
|
||||
|
||||
sources=("codemods" "packages")
|
||||
|
||||
for source in "${sources[@]}"; do
|
||||
for f in $source/*; do
|
||||
if [ -n "$TEST_ONLY" ] && [[ `basename $f` != *"$TEST_ONLY"* ]]; then
|
||||
continue
|
||||
fi
|
||||
# Exclude babel-standalone from coverage runs
|
||||
if [ "$TEST_TYPE" = "cov" ] && [[ `basename $f` = 'babel-standalone' || `basename $f` = 'babel-preset-env-standalone' ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -d "$f/test" ]; then
|
||||
TEST_DIRS="$f/test $TEST_DIRS"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
echo $TEST_DIRS
|
||||
@@ -1,6 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
testDirs=`TEST_TYPE=cov scripts/_get-test-directories.sh`
|
||||
node_modules/.bin/nyc node_modules/mocha/bin/_mocha --opts test/mocha.opts $testDirs
|
||||
node_modules/.bin/nyc report --reporter=json
|
||||
jestArgs="--coverage"
|
||||
|
||||
if [ -n "$CI" ]; then
|
||||
jestArgs="${jestArgs} --runInBand --ci"
|
||||
fi
|
||||
|
||||
node_modules/.bin/jest $jestArgs
|
||||
|
||||
@@ -6,9 +6,15 @@ if [ -z "$TEST_GREP" ]; then
|
||||
fi
|
||||
|
||||
node="node"
|
||||
jestArgs=""
|
||||
|
||||
if [ "$TEST_DEBUG" ]; then
|
||||
node="node --inspect-brk"
|
||||
node="node --inspect-brk"
|
||||
jestArgs="${jestArgs} --runInBand"
|
||||
fi
|
||||
|
||||
$node node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --grep "$TEST_GREP"
|
||||
if [ -n "$CI" ]; then
|
||||
jestArgs="${jestArgs} --runInBand --ci"
|
||||
fi
|
||||
|
||||
$node node_modules/.bin/jest $jestArgs "$TEST_GREP"
|
||||
|
||||
Reference in New Issue
Block a user