0.0.1 • Published 10 years ago

pre-tape v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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

10 years ago

0.0.0

10 years ago