I'm having trouble seeing exceptions thrown when I test code with jasmine-node
. I've tried the --captureExceptions
flag with no luck.
Minimal example:
test/mySpec.js
var r = require('./badness.js')
describe("things:", function(){
it("can", function(){
expect(r()).toBe("work")
})
})
test/badness.js
module.exports = function(){
throw "badness";
return "work";
};
Try running jasmine
npm install jasmine-node --save-dev
$ ./node_modules/.bin/jasmine-node --captureExceptions test/
F
Failures:
1) things: can
Message:
badness
Stacktrace:
undefined
Finished in 0.004 seconds
1 test, 1 assertion, 1 failure, 0 skipped
I would have expected a stack trace or indication of where the error was thrown from. Is this possible / excepted? A bug, or my incorrect expectations?