Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 20, 2021
Merged

Conversation

mcollina
Copy link
Contributor

Fixes #531

@mcollina
Copy link
Contributor Author

@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
Copy link

codecov-io commented Feb 20, 2021

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%) ⬇️

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 ljharb changed the title Adds t.teardown() [New] add .teardown() on t instances Feb 20, 2021
@ljharb ljharb added the semver-minor: new stuff Any additions. label Feb 20, 2021
@ljharb
Copy link
Collaborator

ljharb commented Feb 20, 2021

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

@ljharb
Copy link
Collaborator

ljharb commented Feb 20, 2021

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.

ljharb and others added 2 commits February 20, 2021 12:50
Fixes tape-testing#531.

Co-authored-by: Matteo Collina <hello@matteocollina.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
@mcollina
Copy link
Contributor Author

wow. node v0.6!

@ljharb
Copy link
Collaborator

ljharb commented Feb 20, 2021

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

@ljharb ljharb merged commit d3fc2ff into tape-testing:master Feb 20, 2021
ljharb added a commit that referenced this pull request Feb 20, 2021
 - [New] add `.teardown()` on `t` instances (#546)
 - [readme] improve `t.throws` documentation (#542)
 - [readme] improve `t.throws`/`t.doesNotThrow` documentation (#541)
 - [Deps] update `call-bind`, `is-regex`, `resolve`
 - [Dev Deps] update `eslint`, `aud`
 - [Tests] exclude node v0.6, for now
@ljharb
Copy link
Collaborator

ljharb commented Feb 20, 2021

Released in v5.2.0

ljharb added a commit that referenced this pull request Jul 28, 2021
 - [New] add `.teardown()` on `t` instances (#546)
 - [New] Include name of test in log when test times out (#524)
 - [Refactor] avoid reassigning arguments
 - [Refactor] remove unused line, unneeded var initialization; add missing `new`
 - [Refactor] remove use of legacy `exports`
 - [Refactor] Avoid setting message property on primitives; use strict mode to catch this
 - [Refactor] generalize error message from calling `.end` more than once
 - [Refactor] use `call-bind/callBound` instead of `function-bind` directly
 - [readme] improve `t.throws` documentation (#541)
 - [readme] Another way to create custom reportersA (#556)
 - [readme] remove long-dead testling-ci badge
 - [readme] add `tape-describe` to 'other' section (#523)
 - [readme] remove travis badge; add actions and codecov badges
 - [eslint] remove useless regex escapes
 - [eslint] fully enable `@ljharb` eslint config
 - [meta] do not publish github action workflow files
 - [meta] add `safe-publish-latest`; use `prepublishOnly` script for npm 7+
 - [meta] run `aud` in `posttest`
 - [Deps] update `glob`, `is-regex`, `object-inspect`, `resolve`, `string.prototype.trim`
 - [Dev Deps] update `eslint`
 - [actions] use `node/install` instead of `node/run`; use `codecov` action
 - [Tests] exclude examples from coverage
 - [Tests] ensure bin/tape is linted
 - [Tests] make `stripFullStack` output an array of lines, for better failure messages
 - [Tests] handle stack differences in node 15
 - [Tests] add test case for #519 for test.comment() in createStream/objectMode context
ljharb added a commit that referenced this pull request Jul 28, 2021
v4.14.0

 - [New] add `.teardown()` on `t` instances (#546)
 - [New] Include name of test in log when test times out (#524)
 - [Refactor] avoid reassigning arguments
 - [Refactor] remove unused line, unneeded var initialization; add missing `new`
 - [Refactor] remove use of legacy `exports`
 - [Refactor] Avoid setting message property on primitives; use strict mode to catch this
 - [Refactor] generalize error message from calling `.end` more than once
 - [Refactor] use `call-bind/callBound` instead of `function-bind` directly
 - [readme] improve `t.throws` documentation (#541)
 - [readme] Another way to create custom reportersA (#556)
 - [readme] remove long-dead testling-ci badge
 - [readme] add `tape-describe` to 'other' section (#523)
 - [readme] remove travis badge; add actions and codecov badges
 - [eslint] remove useless regex escapes
 - [eslint] fully enable `@ljharb` eslint config
 - [meta] do not publish github action workflow files
 - [meta] add `safe-publish-latest`; use `prepublishOnly` script for npm 7+
 - [meta] run `aud` in `posttest`
 - [Deps] update `glob`, `is-regex`, `object-inspect`, `resolve`, `string.prototype.trim`
 - [Dev Deps] update `eslint`
 - [actions] use `node/install` instead of `node/run`; use `codecov` action
 - [Tests] exclude examples from coverage
 - [Tests] ensure bin/tape is linted
 - [Tests] make `stripFullStack` output an array of lines, for better failure messages
 - [Tests] handle stack differences in node 15
 - [Tests] add test case for #519 for test.comment() in createStream/objectMode context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add beforeAll(), afterAll(), beforeEach(), afterEach()
3 participants