@@ -4,10 +4,15 @@ var path = require('path');
4
4
var minimist = require ( 'minimist' ) ;
5
5
var constants = require ( '../../tasks/util/constants' ) ;
6
6
7
- var isCI = ! ! process . env . CI ;
7
+ var isCI = Boolean ( process . env . CI ) ;
8
+
8
9
var argv = minimist ( process . argv . slice ( 4 ) , {
9
10
string : [ 'bundleTest' , 'width' , 'height' ] ,
10
- 'boolean' : [ 'info' , 'nowatch' , 'failFast' , 'verbose' , 'Chrome' , 'Firefox' , 'IE11' ] ,
11
+ 'boolean' : [
12
+ 'info' ,
13
+ 'nowatch' , 'failFast' , 'verbose' , 'randomize' ,
14
+ 'Chrome' , 'Firefox' , 'IE11'
15
+ ] ,
11
16
alias : {
12
17
'Chrome' : 'chrome' ,
13
18
'Firefox' : [ 'firefox' , 'FF' ] ,
@@ -21,6 +26,7 @@ var argv = minimist(process.argv.slice(4), {
21
26
nowatch : isCI ,
22
27
failFast : false ,
23
28
verbose : false ,
29
+ randomize : false ,
24
30
width : '1035' ,
25
31
height : '617'
26
32
}
@@ -60,6 +66,7 @@ if(argv.info) {
60
66
' - `--failFast` (dflt: `false`): exit karma upon first test failure' ,
61
67
' - `--verbose` (dflt: `false`): show test result using verbose reporter' ,
62
68
' - `--showSkipped` (dflt: `false`): show tests that are skipped' ,
69
+ ' - `--randomize` (dflt: `false`): randomize test ordering (useful to detect bad test teardown)' ,
63
70
' - `--tags`: run only test with given tags (using the `jasmine-spec-tags` framework)' ,
64
71
' - `--width`(dflt: 1035): set width of the browser window' ,
65
72
' - `--height` (dflt: 617): set height of the browser window' ,
@@ -224,27 +231,32 @@ func.defaultConfig = {
224
231
debug : true
225
232
} ,
226
233
227
- // Options for `karma-jasmine-spec-tags`
228
- // see https://www.npmjs.com/package/karma-jasmine-spec-tags
229
- //
230
- // A few tests don't behave well on CI
231
- // add @noCI to the spec description to skip a spec on CI
232
- //
233
- // Although not recommended, some tests "depend" on other
234
- // tests to pass (e.g. the Plotly.react tests check that
235
- // all available traces and transforms are tested). Tag these
236
- // with @noCIdep , so that
237
- // - $ npm run test-jasmine -- tags=noCI,noCIdep
238
- // can pass.
239
- //
240
- // Label tests that require a WebGL-context by @gl so that
241
- // they can be skipped using:
242
- // - $ npm run test-jasmine -- --skip-tags=gl
243
- // or run is isolation easily using:
244
- // - $ npm run test-jasmine -- --tags=gl
245
234
client : {
235
+ // Options for `karma-jasmine-spec-tags`
236
+ // see https://www.npmjs.com/package/karma-jasmine-spec-tags
237
+ //
238
+ // A few tests don't behave well on CI
239
+ // add @noCI to the spec description to skip a spec on CI
240
+ //
241
+ // Although not recommended, some tests "depend" on other
242
+ // tests to pass (e.g. the Plotly.react tests check that
243
+ // all available traces and transforms are tested). Tag these
244
+ // with @noCIdep , so that
245
+ // - $ npm run test-jasmine -- tags=noCI,noCIdep
246
+ // can pass.
247
+ //
248
+ // Label tests that require a WebGL-context by @gl so that
249
+ // they can be skipped using:
250
+ // - $ npm run test-jasmine -- --skip-tags=gl
251
+ // or run is isolation easily using:
252
+ // - $ npm run test-jasmine -- --tags=gl
246
253
tagPrefix : '@' ,
247
- skipTags : isCI ? 'noCI' : null
254
+ skipTags : isCI ? 'noCI' : null ,
255
+
256
+ // See https://jasmine.github.io/api/3.4/Configuration.html
257
+ jasmine : {
258
+ random : argv . randomize
259
+ }
248
260
} ,
249
261
250
262
// use 'karma-spec-reporter' to log info about skipped specs
@@ -259,6 +271,7 @@ func.defaultConfig = {
259
271
failFast : false
260
272
} ,
261
273
274
+ // TODO !!!
262
275
// e.g. when a test file does not container a given spec tags
263
276
failOnEmptyTestSuite : false
264
277
} ;
0 commit comments