@tapjs/before-each
a built-in tap extension for t.beforeEach()
Last updated a year ago by isaacs .
BlueOak-1.0.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @tapjs/before-each 
SYNC missed versions from official npm registry.

@tapjs/before-each

A default tap plugin providing t.beforeEach().

USAGE

This plugin is installed with tap by default. If you had previously removed it, you can tap plugin add @tapjs/before-each to bring it back.

import t from 'tap'
t.beforeEach(t => {
  // this will run before each child test, all of their child
  // tests, and so on
  // the parameter is the child test that is about to start.
})

If the method returns a promise, it will be awaited before moving on to the next test.

The beforeEach method is called for all child tests, not just direct children. "Closer" ancestor beforeEach methods are called after further ancestors.

For example, this test:

import t from 'tap'
t.beforeEach(t => {
  console.error('root before each', t.name)
})

t.test('parent test', t => {
  t.beforeEach(t => {
    console.error('parent before each', t.name)
  })
  t.test('child test', t => t.end())
  t.end()
})

will print:

root before each parent test
root before each child test
parent before each child test

Current Tags

  • 4.0.0                                ...           latest (4 months ago)
  • 1.0.0                                ...           pre (a year ago)

68 Versions

  • 4.0.0                                ...           4 months ago
  • 3.0.3                                ...           5 months ago
  • 3.0.2                                ...           5 months ago
  • 3.0.1                                ...           5 months ago
  • 3.0.0                                ...           5 months ago
  • 2.0.8                                ...           5 months ago
  • 2.0.7                                ...           5 months ago
  • 2.0.6                                ...           5 months ago
  • 2.0.5                                ...           5 months ago
  • 2.0.4                                ...           5 months ago
  • 2.0.3                                ...           5 months ago
  • 2.0.2                                ...           5 months ago
  • 2.0.1                                ...           6 months ago
  • 2.0.0                                ...           6 months ago
  • 1.1.22                                ...           6 months ago
  • 1.1.21                                ...           6 months ago
  • 1.1.20                                ...           8 months ago
  • 1.1.19                                ...           8 months ago
  • 1.1.18                                ...           10 months ago
  • 1.1.17                                ...           a year ago
  • 1.1.16                                ...           a year ago
  • 1.1.15                                ...           a year ago
  • 1.1.14                                ...           a year ago
  • 1.1.13                                ...           a year ago
  • 1.1.12                                ...           a year ago
  • 1.1.11                                ...           a year ago
  • 1.1.10                                ...           a year ago
  • 1.1.9                                ...           a year ago
  • 1.1.8                                ...           a year ago
  • 1.1.7                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.0.0-22                                ...           a year ago
  • 0.0.0-21                                ...           a year ago
  • 0.0.0-20                                ...           a year ago
  • 0.0.0-19                                ...           a year ago
  • 0.0.0-18                                ...           a year ago
  • 0.0.0-17                                ...           a year ago
  • 0.0.0-16                                ...           a year ago
  • 0.0.0-15                                ...           a year ago
  • 0.0.0-14                                ...           a year ago
  • 0.0.0-13                                ...           a year ago
  • 0.0.0-12                                ...           a year ago
  • 0.0.0-11                                ...           a year ago
  • 0.0.0-10                                ...           a year ago
  • 0.0.0-9                                ...           a year ago
  • 0.0.0-8                                ...           a year ago
  • 0.0.0-7                                ...           a year ago
  • 0.0.0-6                                ...           a year ago
  • 0.0.0-5                                ...           a year ago
  • 0.0.0-4                                ...           a year ago
  • 0.0.0-3                                ...           a year ago
  • 0.0.0-2                                ...           a year ago
  • 0.0.0-1                                ...           a year ago
  • 0.0.0-0                                ...           a year ago
Maintainers (2)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (0)
None
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE