Skip to content

Commit fe6782d

Browse files
committed
add doNotFailOnEmptyTestSuite CLI option
... and set for npm run test-jasmine "$s" --tags=gl --skip-tags=noCI so that suites (e.g. choroplethmapbox_test.js) where all @gl tests are also @noci do not fail.
1 parent 22c2a1e commit fe6782d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.circleci/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ case $1 in
5555

5656
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=5 --tag=gl | circleci tests split))
5757
for s in ${SHARDS[@]}; do
58-
retry npm run test-jasmine -- "$s" --tags=gl --skip-tags=noCI --showSkipped
58+
retry npm run test-jasmine -- "$s" --tags=gl --skip-tags=noCI --showSkipped --doNotFailOnEmptyTestSuite
5959
done
6060

6161
exit $EXIT_STATE

test/jasmine/karma.conf.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ var argv = minimist(process.argv.slice(4), {
1010
string: ['bundleTest', 'width', 'height'],
1111
'boolean': [
1212
'info',
13-
'nowatch', 'failFast', 'verbose', 'randomize',
13+
'nowatch', 'verbose', 'randomize',
14+
'failFast', 'doNotFailOnEmptyTestSuite',
1415
'Chrome', 'Firefox', 'IE11'
1516
],
1617
alias: {
@@ -19,14 +20,15 @@ var argv = minimist(process.argv.slice(4), {
1920
'IE11': ['ie11'],
2021
'bundleTest': ['bundletest', 'bundle_test'],
2122
'nowatch': 'no-watch',
22-
'failFast': 'fail-fast'
23+
'failFast': 'fail-fast',
2324
},
2425
'default': {
2526
info: false,
2627
nowatch: isCI,
27-
failFast: false,
2828
verbose: false,
2929
randomize: false,
30+
failFast: false,
31+
doNotFailOnEmptyTestSuite: false,
3032
width: '1035',
3133
height: '617'
3234
}
@@ -64,6 +66,7 @@ if(argv.info) {
6466
' - `--IE11` (alias -- `ie11`)`: run test in IE11 browser',
6567
' - `--nowatch (dflt: `false`, `true` on CI)`: run karma w/o `autoWatch` / multiple run mode',
6668
' - `--failFast` (dflt: `false`): exit karma upon first test failure',
69+
' - `--doNotFailOnEmptyTestSuite` (dflt: `false`): do not fail run when no spec are ran (either from bundle error OR tag filtering)',
6770
' - `--verbose` (dflt: `false`): show test result using verbose reporter',
6871
' - `--showSkipped` (dflt: `false`): show tests that are skipped',
6972
' - `--randomize` (dflt: `false`): randomize test ordering (useful to detect bad test teardown)',
@@ -266,7 +269,11 @@ func.defaultConfig = {
266269
suppressPassed: true,
267270
suppressSkipped: false,
268271
showSpecTiming: false
269-
}
272+
},
273+
274+
// set to `true` e.g. for mapbox suites where:
275+
// --tags=gl --skip-tags=noCI result in empty test run
276+
failOnEmptyTestSuite: !argv.doNotFailOnEmptyTestSuite
270277
};
271278

272279
func.defaultConfig.preprocessors[pathToCustomMatchers] = ['browserify'];

0 commit comments

Comments
 (0)