Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.