Skip to content

Commit

Permalink
Include logs from successful hooks in TAP output
Browse files Browse the repository at this point in the history
  • Loading branch information
yovasx2 authored and novemberborn committed Jun 10, 2019
1 parent ac212ba commit 007c7af
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/reporters/tap.js
Expand Up @@ -128,6 +128,9 @@ class TapReporter {
case 'hook-failed':
this.writeTest(evt, {passed: false, todo: false, skip: false});
break;
case 'hook-finished':
this.writeTest(evt, {passed: true, todo: false, skip: false});
break;
case 'internal-error':
this.writeCrash(evt);
break;
Expand Down
35 changes: 33 additions & 2 deletions test/reporters/tap.regular.log
Expand Up @@ -239,18 +239,49 @@ not ok 26 - test › implementation throws non-error
# slow › slow
ok 27 - slow › slow
---tty-stream-chunk-separator
# output-in-hook › before hook
ok 28 - output-in-hook › before hook
---tty-stream-chunk-separator
# output-in-hook › before hook
ok 29 - output-in-hook › before hook
* before
---tty-stream-chunk-separator
# output-in-hook › beforeEach hook for passing test
ok 30 - output-in-hook › beforeEach hook for passing test
* beforeEach
---tty-stream-chunk-separator
# output-in-hook › beforeEach hook for failing test
ok 31 - output-in-hook › beforeEach hook for failing test
* beforeEach
---tty-stream-chunk-separator
# output-in-hook › passing test
ok 28 - output-in-hook › passing test
ok 32 - output-in-hook › passing test
---tty-stream-chunk-separator
# output-in-hook › failing test
not ok 29 - output-in-hook › failing test
not ok 33 - output-in-hook › failing test
---
name: AssertionError
message: Test failed via `t.fail()`
assertion: fail
at: 'fail (output-in-hook.js:34:4)'
...
---tty-stream-chunk-separator
# output-in-hook › afterEach hook for passing test
ok 34 - output-in-hook › afterEach hook for passing test
* afterEach
---tty-stream-chunk-separator
# output-in-hook › afterEach.always hook for failing test
ok 35 - output-in-hook › afterEach.always hook for failing test
* afterEachAlways
---tty-stream-chunk-separator
# output-in-hook › afterEach.always hook for passing test
ok 36 - output-in-hook › afterEach.always hook for passing test
* afterEachAlways
---tty-stream-chunk-separator
# output-in-hook › cleanup
ok 37 - output-in-hook › cleanup
* afterAlways
---tty-stream-chunk-separator

1..23
# tests 22
Expand Down

0 comments on commit 007c7af

Please sign in to comment.