airtap
Version:
Run TAP unit tests in 1789+ browsers
53 lines (42 loc) • 849 B
JavaScript
var test = require('tape')
// https://github.com/defunctzombie/zuul/issues/145
test('ok', function (t) {
t.pass()
t.end()
})
// https://github.com/defunctzombie/zuul/issues/145
test('fail', function (t) {
t.ok(false)
t.end()
})
test('suite', function (t) {
t.ok(true, 'yeah')
t.ok(false, 'WOOPS')
t.fail(false)
t.end()
})
test('pass', function (t) {
t.pass()
t.end()
})
test('plan', function (t) {
t.plan(1)
setTimeout(function () {
t.equal(true, true, 'true is true AWESOME')
}, 10)
})
test('failed plan', { timeout: 200 }, function (t) {
t.plan(2)
t.ok(true, 'one assert')
})
// nothing to be done
test.skip('skipped', function (t) {
t.ok(false)
})
test('error', function (t) {
t.ifError(new Error('test'))
t.end()
})
// test console still ok
console.log({ hey: 'you' })
console.log(1, 2, [3, 4])