UNPKG

332 BJavaScriptView Raw
1var test = require('../');
2
3function fn() {
4 throw new TypeError('RegExp');
5}
6
7test('throws', function (t) {
8 t.throws(fn);
9 t.end();
10});
11
12test('throws (RegExp match)', function (t) {
13 t.throws(fn, /RegExp/);
14 t.end();
15});
16
17test('throws (Function match)', function (t) {
18 t.throws(fn, TypeError);
19 t.end();
20});