Jasmine is supported both as a testing framework and a spy library. It will be auto-detected if available.
Use helpers
to run this before setting up test files:
{
"helpers": ["../node_modules/console-fail-test/setup.js"]
}
Note that helper paths may be resolved relative to your spec directory.
Alternately, if you have a helper file already being run first, or you'd like to manually enable this in individual files, you can use the Node API:
// someSpec.js
require("console-fail-test").cft();
Global console
methods will be replaced by jasmine.createSpy()
spies.
You can inspect them at runtime as usual per Jasmine spies.
See Jasmine's spy docs.