-
-
Save toddself/1dd2876d120f86ab2871 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 test = require('tape').test; | |
test('throwing', function(t){ | |
t.throws(function(){ | |
throw new Error('test'); | |
}, 'threw'); | |
t.end(); | |
}); |
Author
toddself
commented
Feb 20, 2014
var test = require('tape').test;
test('throwing', function(t){
t.throws(function(){
throw new Error('test');
}, /foo/, 'threw');
t.end();
});
13:32:07 ~/src/test
↳ node_modules/.bin/tape test.js
TAP version 13
# throwing
not ok 1 threw
---
operator: throws
expected: "/foo/"
actual: {"message":"test"}
at: Test._cb (/Users/tkenned2/src/test/test.js:4:5)
...
1..1
# tests 1
# pass 0
# fail 1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment