I've got an error thrown like so:
if (somethingBadHappened) {
throw new Error('what were you thinking, batman?')
}
Now I want to write a test to check that this throws when expected:
should(MyClass.methodThatShouldThrow()).throws('what were you thinking, batman?')
But that actually throws the error. What am I doing wrong? Should.js docs are pretty light, since it inherits from assert.throws
, but even the docs for that doesn't work in the 'should.js' way?