Skip to content

Commit b81edfb

Browse files
novemberbornkevva
authored andcommitted
Use --verbose when testing CLI output (#1477)
It cannot be guaranteed that all lines output by the mini reporter are captured in the stderr of the CLI invocation during testing. Use --verbose when matching output that the mini reporter may otherwise rewrite. Somewhere on at least Node.js 8.2.1, when the package-lock.json is discarded prior to installation, something in our dependency tree is different which results in the test title no longer being in the stderr of the AVA CLI. Compare: ``` ⠋ ESC[2KESC[1AESC[2KESC[G ⠙ ESC[2KESC[1AESC[2KESC[G ⠹ ESC[2KESC[1AESC[2KESC[G ⠸ ESC[2KESC[1AESC[2KESC[G ⠼ ESC[2KESC[1AESC[2KESC[G ⠴ ESC[2KESC[1AESC[2KESC[G ⠦ ESC[2KESC[1AESC[2KESC[G ⠦ test › works… 1 passedESC[2KESC[1AESC[2KESC[1AESC[2KESC[1AESC[2KESC[G 1 passed [18:32:54] ``` Versus: ``` ⠋ ESC[2KESC[1AESC[2KESC[G ⠙ ESC[2KESC[1AESC[2KESC[G ⠹ ESC[2KESC[1AESC[2KESC[G ⠸ ESC[2KESC[1AESC[2KESC[G ⠼ ESC[2KESC[1AESC[2KESC[G ⠴ ESC[2KESC[1AESC[2KESC[G ⠴ … 1 passedESC[2KESC[1AESC[2KESC[1AESC[2KESC[1AESC[2KESC[G ⠦ … 1 passedESC[2KESC[1AESC[2KESC[1AESC[2KESC[1AESC[2KESC[G 1 passed [18:35:49] ```
1 parent 6c2ed9e commit b81edfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ test('watcher reruns test files when snapshot dependencies change', t => {
365365
test('`"tap": true` config is ignored when --watch is given', t => {
366366
let killed = false;
367367

368-
const child = execCli(['--watch', 'test.js'], {dirname: 'fixture/watcher/tap-in-conf'}, () => {
368+
const child = execCli(['--watch', '--verbose', 'test.js'], {dirname: 'fixture/watcher/tap-in-conf'}, () => {
369369
t.ok(killed);
370370
t.end();
371371
});

0 commit comments

Comments
 (0)