Socket
Book a DemoInstallSign in
Socket

karma-cucumber-reporter

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-cucumber-reporter

Reporter that transforms test results from Karma to Cucumber format

1.0.4
latest
Source
npmnpm
Version published
Weekly downloads
6.9K
-15.78%
Maintainers
1
Weekly downloads
 
Created
Source

Karma Cucumber Reporter

Transforms Karma test output to Cucumber format which can be postprocessed by cucumber-reporting.

Installation

npm i -D karma-cucumber-reporter

Usage

Tests have to be written with a specific syntax to be recognized and translated correctly.

describe('PREFIX FEATURE', function () {
  describe('SCENARIO A', function () { //... });

  describe('SCENARIO A', function () { //... });
});
  • The test is only included if the PREFIX string matches with the prefix option.

  • There always have to be at least one scenario, i.e. an inner describe block.

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    reporters: ['cucumber'],
  });
};

If you use multiple plugins, you have to add karma-cucumber-reporter as well:

plugins: [
  // ...
  require('karma-cucumber-reporter'),
],

Options

out

Type: String

File location to write to. Defaults to stdout if not present.

// karma.conf.js
module.exports = function(config) {
  config.set({
    reporters: ['cucumber'],
    cucumberReporter: {
      out: './cucumber.json'
    }
  });
};

prefix

Type: String

Prefix which indicates that a test should be include in the report.

// karma.conf.js
module.exports = function(config) {
  config.set({
    reporters: ['cucumber'],
    cucumberReporter: {
      prefix: 'XYZ'
    }
  });
};

Example

For an example, please have a look at the examples folder. It will produce a report like this when you run npm test:

Keywords

karma

FAQs

Package last updated on 12 Feb 2020

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.