tape-testing / tape

tap-producing test harness for node and browsers
MIT License
5.77k stars 307 forks source link

[New] add `.teardown()` on `t` instances #546

Closed mcollina closed 3 years ago

mcollina commented 3 years ago

Fixes #531

mcollina commented 3 years ago

@ljharb I don't think we need an ending state, I did a few checks and I don't think we could trigger that situation.

Let me know if anything is missing.

codecov-io commented 3 years ago

Codecov Report

Merging #546 (d3fc2ff) into master (8c52d12) will increase coverage by 0.50%. The diff coverage is 86.20%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #546      +/-   ##
==========================================
+ Coverage   74.15%   74.65%   +0.50%     
==========================================
  Files          19       19              
  Lines         766      789      +23     
  Branches      146      151       +5     
==========================================
+ Hits          568      589      +21     
- Misses        198      200       +2     
Impacted Files Coverage Δ
lib/test.js 95.72% <86.20%> (-0.32%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8c52d12...d3fc2ff. Read the comment docs.

ljharb commented 3 years ago

Updated the readme, and added in a few more test cases (and fixes for those) inspired by https://github.com/avajs/ava/pull/2459 - non-function teardowns will now fail the test, and an error inside a teardown won't stop successive teardowns from running.

ljharb commented 3 years ago

The only failing test is node v0.6, which should have been failing since #318, but of course, tests weren't running on 0.6 at the time; and it also wasn't tested in the last travis build: https://travis-ci.org/github/substack/tape/builds/739518509, so the real confusion is why it wasn't failing in #538.

I'm just going to exclude v0.6 for now, since the last version of tap that supported v0.6 was a very long time ago.

mcollina commented 3 years ago

wow. node v0.6!

ljharb commented 3 years ago

@mcollina yup, i basically support everything forever :-)

ljharb commented 3 years ago

Released in v5.2.0