1.1.20 • Published 1 month ago

@tapjs/before-each v1.1.20

Weekly downloads
-
License
BlueOak-1.0.0
Repository
github
Last release
1 month ago

@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
1.1.20

1 month ago

1.1.19

2 months ago

1.1.18

3 months ago

1.1.17

6 months ago

1.1.16

6 months ago

1.1.15

6 months ago

1.1.14

6 months ago

1.1.13

7 months ago

1.1.12

7 months ago

1.1.11

7 months ago

1.1.10

7 months ago

1.1.9

7 months ago

1.1.8

7 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

0.0.0-22

8 months ago

0.0.0-21

8 months ago

0.0.0-20

8 months ago

0.0.0-19

8 months ago

0.0.0-18

8 months ago

0.0.0-17

8 months ago

0.0.0-16

8 months ago

0.0.0-15

9 months ago

0.0.0-14

9 months ago

0.0.0-13

9 months ago

0.0.0-12

9 months ago

0.0.0-11

9 months ago

0.0.0-10

9 months ago

0.0.0-9

9 months ago

0.0.0-8

9 months ago

0.0.0-7

9 months ago

0.0.0-6

9 months ago

0.0.0-5

9 months ago

0.0.0-4

9 months ago

0.0.0-3

9 months ago

0.0.0-2

9 months ago

0.0.0-1

9 months ago

0.0.0-0

9 months ago