@tapjs/after-each
A default tap plugin providing t.afterEach()
.
USAGE
This plugin is installed with tap by default. If you had
previously removed it, you can tap plugin add @tapjs/after-each
to
bring it back.
import t from 'tap'
t.afterEach(t => {
})
If the method returns a promise, it will be awaited before moving
on to the next test.
The afterEach
method is called for all child tests, not just
direct children. "Closer" ancestor afterEach
methods are called
before further ancestors.
For example, this test:
import t from 'tap'
t.afterEach(t => {
console.error('root after each', t.name)
})
t.test('parent test', t => {
t.afterEach(t => {
console.error('parent after each', t.name)
})
t.test('child test', t => t.end())
t.end()
})
will print:
parent after each child test
root after each child test
root after each parent test