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 🙏

© 2026 – Pkg Stats / Ryan Hefner

wdio-coherent-reporter

v1.0.4

Published

A WebdriverIO plugin. Outputs success and failure information for suites and tests, which may be running in parallel, on a per-suite basis, at the completion of the suite.

Downloads

25

Readme

wdio-coherent-reporter

A WebdriverIO plugin. Outputs success and failure information for suites and tests, which may be running in parallel, on a per-suite basis, at the completion of the suite.

Magic number computer, running on chrome
  ✓ can add two numbers (10ms)
  ✓ can subtract two numbers (9ms)
  ✓ can multiply two numbers (12ms)

Magic number computer, running on firefox
  ✓ can add two numbers (10ms)
  ✖ can subtract two numbers (3096ms)
  Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
    at Timeout._onTimeout (~/Projects/magicComputer/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1812:23)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)

  ✓ can multiply two numbers (13ms)

wdio-coherent-reporter is compatible with WDIO version 4.

Installation

The easiest way is to keep wdio-coherent-reporter as a devDependency in your package.json.

{
  "devDependencies": {
    "wdio-coherent-reporter": "~1.0.1"
  }
}

You can simple do it by:

npm install wdio-coherent-reporter --save-dev

Instructions on how to install WebdriverIO can be found here.

Usage

wdio-coherent-reporter builds on top of ideas presented in the standard wdio-spec-reporter plugin, by also allowing a test writer to write messages which will be written to the console inline with suite and test progress messages. The test writer can send an object with a property event set to coherent:message, with a property message, and this will be reported after the test name, and before the completion message.

describe('Magic number computer', function() {
  it('can add two numbers', function() {
    const a = 3;
    const b = 4;
    process.send({ event: 'coherent:message', message: 'About to add two numbers...', currentSuite, currentTest });
    expect(computer.add(a, b)).toBe(7);
  });
});
Magic number computer, running on chrome
  About to add two numbers...
  ✓ can add two numbers (10ms)

The currentSuite and currentTest objects must be provided in order for wdio-coherent-reporter to know which suite and test to write the message to. These objects are broadcast by the wdio-jasmine-framework via the suite:start, test:start events; the suite:end and test:end events can be used to know when these are completed. The test writer may listen for these events:

process.on('suite:start', function(suite) {
  currentSuite = suite[0];
});

process.on('test:start', function(test) {
  currentTest = test[0];
});

process.on('test:end', function(test) {
  currentTest = null;
});

process.on('suite:end', function(runner) {
  currentSuite = null;
});

The wdio-coherent-reporter can be configured with a custom formatter method, to augment the output. The method must be supplied in a coherentReporterOpts object in wdio.conf.js:

exports.config = {
  // ...

  // Make sure you have the wdio adapter package for the specific framework installed
  // before running any tests.
  framework: 'jasmine',

  //
  // Test reporter for stdout.
  // The following are supported: dot (default), spec, and xunit
  // see also: http://webdriver.io/guide/testrunner/reporters.html
  reporters: ['coherent'],

  //
  // Options to be pass to wdio-coherent-reporter.
  coherentReporterOpts: {
    formatMessage: function(event) {
      return `${event.datestamp} ${event.level}: ${event.message}`;
    }
  },

  // ...
};

When the formatMessage method is provided, the call to process.send may include other properties, which can be used in the method body to create a custom log string:

describe('Magic number computer', function() {
  it('can add two numbers', function() {
    const a = 3;
    const b = 4;
    process.send({ event: 'coherent:message', message: 'About to add two numbers...', currentSuite, currentTest, datastamp: (new Date()).toISOString(), level: 'info' });
    expect(computer.add(a, b)).toBe(7);
  });
});
Magic number computer, running on chrome
  2016-07-05T19:03:51.321Z info: About to add two numbers...
  ✓ can add two numbers (10ms)

This rapidly becomes unweildy for common use across tests, so a logging class might be introduced for some of the heavy lifting:

import { red, yellow, cyan, bold } from 'chalk';

let currentSuite = null,
  currentTest = null;

process.on('suite:start', (suite) => {
  currentSuite = suite[0];
});

process.on('test:start', (test) => {
  currentTest = test[0];
});

process.on('test:end', (test) => {
  currentTest = null;
});

process.on('suite:end', (runner) => {
  currentSuite = null;
});

export function info(message) {
  logAtLevel('info', message);
}

export function failure(message) {
  logAtLevel('error', message);
}

function logAtLevel(level, args) {
  const m = {
    event: 'coherent:message',
    datestamp: new Date().toTimeString(),
    currentSuite,
    currentTest,
    level,
    message
  };
  process.send(m);
}
import { info } from 'logger.js';

describe('Magic number computer', function() {
  it('can add two numbers', function() {
    const a = 3;
    const b = 4;
    info('About to add two numbers...');
    expect(computer.add(a, b)).toBe(7);
  });
});