Socket
Socket
Sign inDemoInstall

jasmine-spec-reporter

Package Overview
Dependencies
1
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jasmine-spec-reporter

Spec reporter for jasmine behavior-driven development framework


Version published
Weekly downloads
931K
decreased by-8.53%
Maintainers
1
Install size
184 kB
Created
Weekly downloads
 

Changelog

Source

0.6.0

  • Add option to configure spec prefixes #14

  • Filter jasmine stacktrace #12

Readme

Source

Build Status jasmine-spec-reporter

Real time console spec reporter for jasmine behavior-driven development testing framework.

Usage

Default options

{
  displayStacktrace: false,     // display stacktrace for each failed assertion
  displayFailuresSummary: true, // display summary of all failures after execution
  displaySuccessfulSpec: true,  // display each successful spec
  displayFailedSpec: true,      // display each failed spec
  displaySkippedSpec: false,    // display each skipped spec
  displaySpecDuration: false,   // display each spec duration
  colors: {
    success: 'green',
    failure: 'red',
    skipped: 'cyan'
  },
  prefixes: {
    success: '✓ ',
    failure: '✗ ',
    skipped: '- '
  }
}

Colors are displayed in the console via colors, you can see all available colors on the project page. You can also disable colors with the option: colors: false.

Protractor

The jasmine-spec-reporter can be used to enhance your Protractor tests execution report.

Install jasmine-spec-reporter via npm:

npm install jasmine-spec-reporter --save-dev

Use it in your Protractor configuration file:

exports.config = {
   // your config here ...

   onPrepare: function() {
      require('jasmine-spec-reporter');
      // add jasmine spec reporter
      jasmine.getEnv().addReporter(new jasmine.SpecReporter({displayStacktrace: true}));
   }
}

Remove protractor dot reporter

For protractor >= 1.0.0-rc2

In your protractor configuration file, add the silent option in the jasmineNodeOpts section:

jasmineNodeOpts: {
   ...
   silent: true
}

For protractor < 1.0.0-rc2

Create a file in your project, for example spec/util/reporter-hack.js, with this code:

var reporters = jasmine.getEnv().reporter.subReporters_;
var jasmineSpecReporter, minijasmineReporter;
for (var i = 0 ; i < reporters.length ; i++) {
  if (reporters[i].callback_ !== undefined) {
    minijasmineReporter = reporters[i];
  }
  if (reporters[i].jasmineCallback !== undefined) {
    jasmineSpecReporter = reporters[i];
  }
}
if (jasmineSpecReporter && minijasmineReporter) {
  jasmineSpecReporter.jasmineCallback = minijasmineReporter.callback_;
  reporters.splice(reporters.indexOf(minijasmineReporter), 1);
} else {
  console.log('Unable to find both reporters');
  console.log('jasmineSpecReporter:\n', jasmineSpecReporter);
  console.log('minijasmineReporter:\n', minijasmineReporter);
}

In you protractor conf, add this file to your spec files:

specs: [
    'spec/util/reporter-hack.js',
    ...
]

Developement

  • install dependencies: npm install
  • launch all unit tests: npm test
  • launch an output example: npm run example

Keywords

FAQs

Last updated on 12 Aug 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc