Skip to content

Instantly share code, notes, and snippets.

@bloodyowl
Created March 7, 2014 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bloodyowl/9411488 to your computer and use it in GitHub Desktop.
Save bloodyowl/9411488 to your computer and use it in GitHub Desktop.
var assert = require("assert")
describe("my-module", function(){
it("should work", function(done){
assert.equal("foo", "foo")
done()
})
it("should respect type", function(done){
assert.notStrictEqual("1", 1)
done()
})
it("should throw", function(done){
assert.throws(function(){
throw new Error()
})
done()
})
})
/*
1..3
ok 1 my-module should work
ok 2 my-module should respect type
ok 3 my-module should throw
# tests 3
# pass 3
# fail 0
*/
var tape = require("tape")
tape("my-module", function(test){
test.equal("foo", "foo", "should work")
test.notStrictEqual("1", 1, "number and string are distinct")
test.throws(function(){
throw new Error()
})
test.end()
})
/*
TAP version 13
# my-module
ok 1 should work
ok 2 number and string are distinct
ok 3 should throw
1..3
# tests 3
# pass 3
# ok
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment