Skip to content

Commit

Permalink
Improve error message for watch mode in CI (#1208)
Browse files Browse the repository at this point in the history
  • Loading branch information
forresst authored and novemberborn committed Jan 25, 2017
1 parent 872d2ed commit 173da28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/recipes/watch-mode.md
Expand Up @@ -85,7 +85,7 @@ The [`.only` modifier] disables watch mode's dependency tracking algorithm. When

## Watch mode and CI

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.
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.

## Manually rerunning all tests

Expand Down
2 changes: 1 addition & 1 deletion lib/cli.js
Expand Up @@ -101,7 +101,7 @@ exports.run = () => {
}

if ((hasFlag('--watch') || hasFlag('-w')) && isCi) {
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.');
throw new Error(colors.error(figures.cross) + ' Watch mode is not available in CI, as it prevents AVA from terminating.');
}

if (hasFlag('--require') || hasFlag('-r')) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli.js
Expand Up @@ -304,7 +304,7 @@ test('bails when config contains `"tap": true` and `"watch": true`', t => {
test(`bails when CI is used while ${watchFlag} is given`, t => {
execCli([watchFlag, 'test.js'], {dirname: 'fixture/watcher', env: {CI: true}}, (err, stdout, stderr) => {
t.is(err.code, 1);
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.');
t.match(stderr, 'Watch mode is not available in CI, as it prevents AVA from terminating.');
t.end();
});
});
Expand Down

0 comments on commit 173da28

Please sign in to comment.