tape-end-hook

1.0.2 • Public • Published

Helps keeping tests more readable

Example:

const test = require('tape')
const atEnd = require('tape-end-hook')
 
test('triple hook, some async', t => {
  t.plan(3)
  let counter = 0
  atEnd(t, () => { t.equal(++counter, 3) })
  atEnd(t, async () => { await sleep(1); t.equal(++counter, 2) })
  atEnd(t, () => { t.equal(++counter, 1) })
  t.end()
})

/tape-end-hook/

    Package Sidebar

    Install

    npm i tape-end-hook

    Weekly Downloads

    0

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • sandhawke