Skip to content

Instantly share code, notes, and snippets.

@max-mapper
Created March 4, 2014 04:11
Show Gist options
  • Save max-mapper/9340149 to your computer and use it in GitHub Desktop.
Save max-mapper/9340149 to your computer and use it in GitHub Desktop.
partial tap output w/ how long each test took
var time = +Date.now()
var testId = 0
console.log('TAP version 13')
tape.createStream({ objectMode: true }).on('data', function (row) {
if (row.type === 'test') {
console.log('# ' + row.name)
}
if (row.type === 'assert') {
testId++
var now = +Date.now()
var diff = now - time
time = now
console.log(row.ok ? 'ok' : 'not ok', testId, row.name, '-', diff + 'ms')
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment