Is there a way to have Jenkins integration in the Javascript Jest testing framework that is built on top of Jasmine?
I've tried to integrate Jest with jasmine-reporters, but didn't manage to get a JUnit XML output. I installed the reporters for Jasmine 1.3 with npm install jasmine-reporters@~1.0.0
and then in my setupTestFrameworkScriptFile
:
require('jasmine-reporters');
jasmine.VERBOSE = true;
jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter({
savePath: "output/"
}));
When I run jest
I get NodeJS attempt: Arguments to path.join must be strings
or NodeJS attempt: Object [object Object] has no method 'join'
.
You're using the syntax of jasmine-reporters 2.x with the 1.x branch. Specifically, you are passing an object of options but you need to send positional arguments.
Don't do this:
Instead, you should do this:
You can check out the source for the list of available options. Here are the current options:
I've managed to get a working version of it in this repo. The problem was I was not mocking
path
andfs
in the test file.Looks like jest-junit is also a option.