gulp-jasmine-phantom icon indicating copy to clipboard operation
gulp-jasmine-phantom copied to clipboard

Support for a JUnit reporter

Open antoine1fr opened this issue 8 years ago • 2 comments

It would be nice to have an alternative JUnit reporter.

It would allow me interface my test suites in Atlassian's Bamboo.

antoine1fr avatar May 02 '16 16:05 antoine1fr

@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.

gwynjudd avatar May 22 '16 23:05 gwynjudd

Here is my jasmine-runner.js

gwynjudd avatar May 23 '16 00:05 gwynjudd