mirror of
https://github.com/bcomnes/deploy-to-neocities.git
synced 2026-01-17 15:06:29 +00:00
28 lines
500 B
JavaScript
28 lines
500 B
JavaScript
var assert = require('.')
|
|
var test = require('tape')
|
|
|
|
test('test', function (t) {
|
|
try {
|
|
assert(true === true) // test that it doesn't throw
|
|
t.pass('does not throw on truthy')
|
|
} catch (e) {
|
|
t.fail()
|
|
}
|
|
|
|
t.throws(assert.bind(null, false), 'throws on falsy')
|
|
|
|
try {
|
|
assert(false)
|
|
} catch (e) {
|
|
t.equal(e.message, '', 'default message')
|
|
}
|
|
|
|
try {
|
|
assert(false, 'hello world')
|
|
} catch (e) {
|
|
t.equal(e.message, 'hello world', 'custom message')
|
|
}
|
|
|
|
t.end()
|
|
})
|