npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

karma-and-protractor-reporter

v1.0.6

Published

A command line reporter for protractor and karma for Test Driven Development. The output is compact and has stacktrace highlighting so it's easy to see which tests are failing as quickly as possible.

Downloads

68

Readme

karma-and-protractor-reporter

A command line reporter for protractor and karma for Test Driven Development. The output is compact and has stacktrace highlighting so it's easy to see which tests are failing as quickly as possible.

How does it looks

The output looks similar in protractor or karma. The protractor stacktrace is filtered (depending on options used) so that jasmine and protractor internals are not shown.

Installation

To install use npm install karma-and-protractor-reporter --save-dev.

Karma Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    frameworks: ['jasmine'],

    // reporters configuration
    reporters: ['mocha'],
    kap: {
      useColors: true,
      showTiming: true,
      style: 'dots',
      stackStyle: 'summary'
    }
  });
};

Protractor Configuration

// protractor.conf.js
exports.config = {
  jasmineNodeOpts: {
    print: function() {}
  },
  onPrepare: function() {
    var KapReporter = require('karma-and-protractor-reporter').KapReporter;
    jasmine.getEnv().addReporter(new KapReporter({
      useColors: true,
      showTiming: true,
      style: 'dots',
      stackStyle: 'summary'
    }));
  }
};

Options

addSpacing

Type: Boolean default true

Set to true to add a new line between tests.

colors

Type: Object default

The following colors are used by default for more options refer to marak/colors.js documentation.

{
  passed: ['green', 'bold'],
  failed: ['red', 'bold'],
  pending: ['yellow', 'bold'],
  other: ['cyan', 'bold'],
  base: ['reset'],
  stack: ['red'],
  stackHighlight: ['red', 'bold']
}

failDot

Type: String default 'F'

If using 'dots' style, this character will be used for each failing test.

indent

Type: String default ' '

This can be changed to override the indentation size.

passDot

Type: String default '*'

If using 'dots' style, this character will be used for each passing test.

pendingDot

Type: String default 'P'

If using 'dots' style, this character will be used for each pending test.

showId

Type: Boolean default false

If set a test id will be displayed beside each test.

showPassed

Type: String default false

Show the description of each passing test. Not available with 'compact' style.

showPending

Type: Boolean default true

Show the description of each pending test. Not available with 'compact' style.

showFailed

Type: Boolean default true

Show the description of each failed test. Not available with 'compact' style.

showTiming

Type: Boolean default true

Show how long each test took to run.

stackStyle

Type: String default 'summary'

stacktraces can be highlighted or abbreviated to help you get to the failing code more quickly.

  • 'summary' less important info is removed from the stacktrace.
  • 'highlight' most important info is hightlighted in the stacktrace.
  • 'default' the stacktrace is not altered.
  • 'none' no stacktrace is shown.

style

Type: String default 'dots'

The overall display can be altered.

  • 'dots' same as normal but a character is displayed for each test runs.
  • 'compact' a more compact view of all the tests that have execute.
  • 'normal' each test renders its outcome. (see 'showPassed', 'showPending', 'showFailed')

useColors

Type: Boolean default true

Use colors in the output.