pre-tape

0.0.1 • Public • Published

pre-tape

setup and teardown hooks for tape

var setup = require('pretape')
 
var test = setup({
    setup: setup
  , teardown: teardown
  , // any events emited on the test such as prerun, run, test, etc
  , prerun: prerun
})
 
function setup(t, done) {
  var self = this
  
  setTimeout(function() {
    self.val = 5
  })
}
 
function prerun(t) {
  // do some pre run stuff
}
 
function teardown(t) {
  delete this.val
}
 
test('val is 5', function(t) {
  t.equal(this.val, 5)
  t.end()
})

/pre-tape/

    Package Sidebar

    Install

    npm i pre-tape

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • hayes