Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// this is a Jasmine helper function used to export results as xunit tests results.
var jasmineReporters = require('jasmine-reporters');
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
var junitReporter = new jasmineReporters.NUnitXmlReporter({
savePath: './',
consolidateAll: false,
});
var textReporter = new SpecReporter({ // add jasmine-spec-reporter
spec: {
displayDuration: true,
}
});
jasmine.getEnv().clearReporters();
jasmine.getEnv().addReporter(junitReporter);
jasmine.getEnv().addReporter(textReporter);
// this is a Jasmine helper function used to export results as xunit tests results.
var jasmineReporters = require('jasmine-reporters');
var nunitReporter = new jasmineReporters.NUnitXmlReporter({
savePath: './',
consolidateAll: false,
});
jasmine.getEnv().addReporter(nunitReporter)
}
}
// BUILT-IN REPORTERS
// additional Jasmine reporters
// https://github.com/larrymyers/jasmine-reporters
var reporter;
// Reporters that only write to a file:
if (ropts.junit) {
reporter = new reporters.JUnitXmlReporter(ropts.junit);
reporter.name = 'JUnit XML Reporter';
addReporter(reporter);
}
if (ropts.nunit) {
reporter = new reporters.NUnitXmlReporter(ropts.nunit);
reporter.name = 'NUnit XML Reporter';
addReporter(reporter);
}
// We will not allow reporters producing command-line output to run at
// the same time, to prevent puzzled outputs.
var conflict = Boolean(ropts.console);
if (!conflict && ropts.terminal) {
conflict = true;
reporter = new reporters.TerminalReporter(ropts.terminal);
reporter.name = 'Terminal Reporter';
addReporter(reporter);
}
if (!conflict && ropts.teamcity) {
conflict = true;
reporter = new reporters.TeamCityReporter(); // no options to set