Created
March 7, 2014 13:30
-
-
Save bloodyowl/9411488 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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