How to use jasmine-reporters - 10 common examples

To help you get started, we’ve selected a few jasmine-reporters examples, based on popular ways it is used in public projects.

github testing-angular-applications / testing-angular-applications / chapter10 / test_plugins / protractor-onprepare-plugin.conf.js View on Github external
onPrepare: () => {
    let jasmineReporters = require('jasmine-reporters');
    let junitReporter = new jasmineReporters.JUnitXmlReporter({

      // setup the output path for the junit reports
      savePath: 'output/',

      // conslidate all true:
      //   output/junitresults.xml
      //
      // conslidate all set to false:
      //   output/junitresults-example1.xml
      //   output/junitresults-example2.xml
      consolidateAll: false
    });
    jasmine.getEnv().addReporter(junitReporter);

    require('ts-node').register({
      project: 'e2e'
github sillsdev / web-languageforge / test / app / protractorConf.js View on Github external
onPrepare: function () {
    /* global angular: false, browser: false, jasmine: false */

    browser.driver.manage().window().maximize();

    if (process.env.TEAMCITY_VERSION) {
      var jasmineReporters = require('jasmine-reporters');
      jasmine.getEnv().addReporter(new jasmineReporters.TeamCityReporter());
    } else {
      var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
      jasmine.getEnv().addReporter(new SpecReporter({
        spec: {
          displayStacktrace: true
        }
      }));
      /*
      jasmine.getEnv().addReporter(new jasmineReporters.TerminalReporter({
        verbosity: browser.params.verbosity, // [0 to 3, jasmine default 2]
        color: true,
        showStack: true
      }));
      */
      var pauseOnFailure = {
        specDone: function (spec) {
github sillsdev / web-languageforge / test / app / protractorConf.languageforge.js View on Github external
browser.driver.manage().window().maximize();

    // Disable animations so e2e tests run more quickly
    var disableNgAnimate = function () {
      angular.module('disableNgAnimate', []).run(['$animate', function ($animate) {
        $animate.enabled(false);
      }]);
    };

    // This seemed to make the tests more flaky rather than less. IJH 2014-12
    //    browser.addMockModule('disableNgAnimate', disableNgAnimate);

    if (process.env.TEAMCITY_VERSION) {
      var jasmineReporters = require('jasmine-reporters');
      jasmine.getEnv().addReporter(new jasmineReporters.TeamCityReporter());
    }
  }
};
github decentralized-identity / did-auth-jose / tests / helpers / reporter.js View on Github external
// 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);
github decentralized-identity / hub-node-core / tests / helpers / reporter.js View on Github external
// 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)
github facebook / jest / test_setup_file.js View on Github external
module.exports = function(global) {
  const {jasmine} = global;

  if (jasmine) {
    // Some of the `jest-runtime` tests are very slow and cause timeouts on
    // Travis CI.
    jasmine.DEFAULT_TIMEOUT_INTERVAL = 70000;

    // Running on AppVeyor, add the custom reporter.
    if (process.env.APPVEYOR_API_URL) {
      jasmine.getEnv().addReporter(new jasmineReporters.AppVeyorReporter());
    }
  }
};
github onury / grunt-jasmine-nodejs / tasks / jasmine.task.js View on Github external
try {
                reporter = jasmineRunner.addReporter(reporter, onComplete);
                enabledReporters.push(reporter.name);
            } catch (error) {
                grunt.log.error(error);
            }
        }

        // 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';
github bkimminich / juice-shop / protractor.conf.js View on Github external
onPrepare: function () {
    const jasmineReporters = require('jasmine-reporters')
    jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
      consolidateAll: true,
      savePath: 'build/reports/e2e_results'
    }))

    // Get all banners out of the way
    browser.get('/#')
    const expiry = new Date()
    expiry.setFullYear(expiry.getFullYear() + 1)
    browser.manage().addCookie({ name: 'cookieconsent_status', value: 'dismiss', expiry })
    browser.manage().addCookie({ name: 'welcomebanner_status', value: 'dismiss', expiry })

    // Ensure score board shows all challenges (by default only 1-star challenges are shown)
    browser.get('/#/score-board')
    element(by.id('btnToggleAllDifficulties')).click()
  }
}
github jribble / grunt-jasmine-node-coverage / tasks / jasmine-node-task.js View on Github external
var addReporters = function addReporters(jasmine) {
    jasmine.env.clearReporters();

    var ropts = options.jasmine.reporters;

    var reporter;
    if (ropts.teamcity) {
      reporter = new reporters.TeamCityReporter(); // no options to set
      reporter.name = 'TeamCity Reporter';
      jasmine.addReporter(reporter);
    }
    else {
      reporter = new SpecReporter(ropts.spec);
      reporter.name = 'Spec Reporter';
      jasmine.addReporter(reporter);
    }
  };
github onury / grunt-jasmine-nodejs / tasks / jasmine.task.js View on Github external
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
            reporter.name = 'TeamCity Reporter';
            addReporter(reporter);
        }
        if (!conflict && ropts.tap) {
            conflict = true;
            reporter = new reporters.TapReporter(); // no options to set
            reporter.name = 'TAP Reporter';
            addReporter(reporter);
        }

        // CUSTOM JASMINE REPORTERS

        if (Array.isArray(options.customReporters)) {
            options.customReporters.forEach(function (customReporter, index) {
                customReporter.name = customReporter.name
                    || 'Custom Reporter #' + (index + 1);