8000 replace 'watch' flag with 'nowatch' · davgit/plotly.js@7cf9943 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7cf9943

Browse files
committed
replace 'watch' flag with 'nowatch'
- `nowatch` is false by default locally and true by default on CI
1 parent 0ff387d commit 7cf9943

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ npm run test-jasmine -- bar axes scatter
131131
which will run tests in the `bar_test.js`, `axes_test.js` and `scatter_test.js`
132132
suites.
133133

134-
To run the tests in an `autoWatch` / auto-bundle / multiple run mode:
134+
To turn off the `autoWatch` / auto-bundle / multiple run mode:
135135

136136
```
137-
npm run test-jasmine -- <suite> --watch
137+
npm run test-jasmine -- <suite> --nowatch
138138
```
139139

140140
In certain situations, you may find that the default reporting is not verbose

tasks/noci_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ EXIT_STATE=0
55
# tests that aren't run on CI
66

77
# jasmine specs with @noCI tag
8-
npm run test-jasmine -- --tags=noCI || EXIT_STATE=$?
8+
npm run test-jasmine -- --tags=noCI --nowatch || EXIT_STATE=$?
99

1010
# mapbox image tests take too much resources on CI
1111
npm run test-image -- mapbox_* || EXIT_STATE=$?

test/jasmine/karma.conf.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ var constants = require('../../tasks/util/constants');
77
var isCI = !!process.env.CIRCLECI;
88
var argv = minimist(process.argv.slice(4), {
99
string: ['bundleTest', 'width', 'height'],
10-
'boolean': ['info', 'watch', 'verbose', 'Chrome', 'Firefox'],
10+
'boolean': ['info', 'nowatch', 'verbose', 'Chrome', 'Firefox'],
1111
alias: {
1212
'Chrome': 'chrome',
1313
'Firefox': ['firefox', 'FF'],
14-
'bundleTest': ['bundletest', 'bundle_test']
14+
'bundleTest': ['bundletest', 'bundle_test'],
15+
'nowatch': 'no-watch'
1516
},
1617
'default': {
1718
info: false,
18-
watch: false,
19+
nowatch: isCI,
1920
verbose: false,
2021
width: '1035',
2122
height: '617'
@@ -28,8 +29,8 @@ if(argv.info) {
2829
'',
2930
'Examples:',
3031
'',
31-
'Run `axes_test.js`, `bar_test.js` and `scatter_test.js` suites in `autoWatch` / multiple run mode:',
32-
' $ npm run test-jasmine -- axes bar_test.js scatter --watch',
32+
'Run `axes_test.js`, `bar_test.js` and `scatter_test.js` suites w/o `autoWatch`:',
33+
' $ npm run test-jasmine -- axes bar_test.js scatter --nowatch',
3334
'',
3435
'Run all tests with the `noCI` tag on Firefox in a 1500px wide window:',
3536
' $ npm run test-jasmine -- --tags=noCI --FF --width=1500',
@@ -47,7 +48,7 @@ if(argv.info) {
4748
' - `--info`: show this info message',
4849
' - `--Chrome` (alias `--chrome`): run test in (our custom) Chrome browser',
4950
' - `--Firefox` (alias `--FF`, `--firefox`): run test in (our custom) Firefox browser',
50-
' - `--watch (dflt: `false`)`: run karma in `autoWatch` / multiple run mode',
51+
' - `--nowatch (dflt: `false`, `true` on CI)`: run karma w/o `autoWatch` / multiple run mode',
5152
' - `--verbose` (dflt: `false`): show test result using verbose reporter',
5253
' - `--tags`: run only test with given tags (using the `jasmine-spec-tags` framework)',
5354
' - `--width`(dflt: 1035): set width of the browser window',
@@ -158,10 +159,10 @@ func.defaultConfig = {
158159
colors: true,
159160

160161
// enable / disable watching file and executing tests whenever any file changes
161-
autoWatch: argv.watch,
162+
autoWatch: !argv.nowatch,
162163

163164
// if true, Karma captures browsers, runs the tests and exits
164-
singleRun: !argv.watch,
165+
singleRun: argv.nowatch,
165166

166167
// how long will Karma wait for a message from a browser before disconnecting (30 ms)
167168
browserNoActivityTimeout: 30000,
@@ -194,7 +195,7 @@ func.defaultConfig = {
194195
browserify: {
195196
transform: [pathToShortcutPath],
196197
extensions: ['.js'],
197-
watch: argv.watch,
198+
watch: !argv.nowatch,
198199
debug: true
199200
},
200201

0 commit comments

Comments
 (0)
0