Skip to content

sandhawke/tape-end-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()
})

About

add at-end hooks for tape, as you go (async okay)

Resources

Stars

Watchers

Forks

Packages

No packages published