Skip to content

Instantly share code, notes, and snippets.

@mraxus
Created November 11, 2013 23:20
Show Gist options
  • Save mraxus/7422408 to your computer and use it in GitHub Desktop.
Save mraxus/7422408 to your computer and use it in GitHub Desktop.
=== TEST SETUPS ===
t.plan(x) // Expect x asserts. If less, test will timeout, if more, test fails
t.end() // End test if not t.plan() is used
t.fail('fail test with this description')
t.bailout("en test right here. No more to run")
// t.bailsOut() wraps a child test and succeeds if it calls bailout()
t.bailsOut(t.test("this should bailout", function (t) {
t.bailout("oh noes, bailing out!")
}))
=== ASSERTS ===
t.assert = t.true = t.ok = function (trueEval, mess)
t.notOk = t.false function (falseEval, mess)
t.equal = t.equals = t.isEqual = t.is = t.strictEqual = t.strictEquals = function (actual, expected, mess)
t.error = function(err, mess)
t.pass = function(mess)
t.fail = function(mess)
t.skip = function(mess)
t.throws(fn, wanted, mess)
t.doesNotThrow(fn, mess)
--=-==-=--
Source:
https://github.com/isaacs/node-tap/blob/master/lib/tap-assert.js:172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment