Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tapjs/after

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tapjs/after - npm Package Compare versions

Comparing version 0.0.0-15 to 0.0.0-16

6

package.json
{
"name": "@tapjs/after",
"version": "0.0.0-15",
"version": "0.0.0-16",
"description": "a built-in tap extension for t.after() and t.teardown()",

@@ -46,6 +46,6 @@ "type": "module",

"peerDependencies": {
"@tapjs/core": "0.0.0-15"
"@tapjs/core": "0.0.0-16"
},
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
"node": ">=16"
},

@@ -52,0 +52,0 @@ "repository": {

# `@tapjs/after`
A default tap plugin providing `t.after()` and `t.teardown()`
A default tap plugin providing `t.after()` and `t.teardown()`.
## USAGE
This plugin is installed with tap by default. If you had
previously removed it, you can `tap plugin add @tapjs/after` to
bring it back.
```ts
import t from 'tap'
t.after(() => {
// this will run after all the tests in this file are done
})
```
The method can be called as either `t.teardown()` or `t.after()`.
In an earlier version of tap, these had slightly different
behaviors, but they are now the same.
If the method returns a promise, it will be awaited before moving
on to the next test.
So, this test:
```js
import t from 'tap'
t.test('first test', t => {
t.teardown(async () => {
// this will wait before moving on
await new Promise(res => setTimeout(res, 100))
console.error('end of first test teardown')
})
console.error('in first test')
t.end()
})
t.test('second test', t => {
console.error('in second test')
t.end()
})
```
will print:
```
in first test
end of first test teardown
in second test
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc