Skip to content

Commit 173da28

Browse files
forresstnovemberborn
authored andcommitted
Improve error message for watch mode in CI (#1208)
1 parent 872d2ed commit 173da28

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/recipes/watch-mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ The [`.only` modifier] disables watch mode's dependency tracking algorithm. When
8585

8686
## Watch mode and CI
8787

88-
If you run AVA in your CI with watch mode, the execution will exit with a error. AVA will not run with the `--watch` (`-w`) option in CI, because CI processes should terminate, and with the `--watch` option, AVA will never terminate.
88+
If you run AVA in your CI with watch mode, the execution will exit with an error (`Error : Watch mode is not available in CI, as it prevents AVA from terminating.`). AVA will not run with the `--watch` (`-w`) option in CI, because CI processes should terminate, and with the `--watch` option, AVA will never terminate.
8989

9090
## Manually rerunning all tests
9191

lib/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ exports.run = () => {
101101
}
102102

103103
if ((hasFlag('--watch') || hasFlag('-w')) && isCi) {
104-
throw new Error(colors.error(figures.cross) + ' AVA will not run with the --watch (-w) option in CI, because CI processes should terminate, and with the --watch option, AVA will never terminate.');
104+
throw new Error(colors.error(figures.cross) + ' Watch mode is not available in CI, as it prevents AVA from terminating.');
105105
}
106106

107107
if (hasFlag('--require') || hasFlag('-r')) {

test/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ test('bails when config contains `"tap": true` and `"watch": true`', t => {
304304
test(`bails when CI is used while ${watchFlag} is given`, t => {
305305
execCli([watchFlag, 'test.js'], {dirname: 'fixture/watcher', env: {CI: true}}, (err, stdout, stderr) => {
306306
t.is(err.code, 1);
307-
t.match(stderr, 'AVA will not run with the --watch (-w) option in CI, because CI processes should terminate, and with the --watch option, AVA will never terminate.');
307+
t.match(stderr, 'Watch mode is not available in CI, as it prevents AVA from terminating.');
308308
t.end();
309309
});
310310
});

0 commit comments

Comments
 (0)