No stack trace for jasmine errors - node

I am using node.js and the node npm jasmine module to run tests. This works fine unless the code causes an error. I do not get the stack. For example, one of my tests only outputs this:

Error: TypeError: Cannot read property 'length' of undefined

No stack trace. This makes finding these errors so time consuming that I am looking for alternatives to jasmine - node.

How can I get a jasmine-node to output a full stack trace with an error? The -verbose command line flag does not.

+5
source share
2 answers

You can use the jasmine-node parameter --captureExceptionsto output a trace of the global exception stack.

+7
source

- node npm, . , , /impl ...

, ,

process.on('uncaughtException',function(e) {
    sys.log("Caught unhandled exception: " + e);
    sys.log(" ---> : " + e.stack);
});
+4

All Articles