Namespace: Should

Should

Should

.throw(function, [constructor/string/regexp], [string/regexp], [message])

Asserts that function will throw an error that is an instance of constructor, or alternately that it will throw an error with message matching regexp.

should.throw(fn, 'function throws a reference error');
should.throw(fn, /function throws a reference error/);
should.throw(fn, ReferenceError);
should.throw(fn, ReferenceError, 'function throws a reference error');
should.throw(fn, ReferenceError, /function throws a reference error/);
Source:
See:

Should

Should

Should

Should

Should