gulp-jasmine-phantom
gulp-jasmine-phantom copied to clipboard
Support for a JUnit reporter
It would be nice to have an alternative JUnit reporter.
It would allow me interface my test suites in Atlassian's Bamboo.
@antoine1fr I figured out how to get this working using the junit-reporter from https://github.com/larrymyers/jasmine-reporters.
.pipe(jasmine({
integration: true, // or false
vendor: 'node_modules/jasmine-reporters/src/junit_reporter.js'
}));
var junitReporter = new jasmineReporters.JUnitXmlReporter({
savePath: '..',
consolidateAll: false
});
jasmine.getEnv().addReporter(junitReporter);
You have to be able to inject a __phantom_writeFile
function into the window namespace when running under phantomJS (integration
is true). I found that the jasmine-runner.js file wasn't quite suitable for this task because it calls phantom.exit() too soon before the test output files were written out. With a small modification to index.js, it was possible to substitute my own and have that working.
If you were running your tests under node then you probably wouldn't have to worry about that previous paragraph.
Here is my jasmine-runner.js