diff --git a/lib/reporters/tap.js b/lib/reporters/tap.js index 1d89cdeff..c91a9ce21 100644 --- a/lib/reporters/tap.js +++ b/lib/reporters/tap.js @@ -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; diff --git a/test/reporters/tap.regular.log b/test/reporters/tap.regular.log index 9e136cbc3..2289b1ca0 100644 --- a/test/reporters/tap.regular.log +++ b/test/reporters/tap.regular.log @@ -239,11 +239,26 @@ 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()` @@ -251,6 +266,22 @@ not ok 29 - output-in-hook › failing test 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