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

@test-runner/core

v0.10.0

Published

Minimal, extensible, isomorphic test runner.

Readme

view on npm npm module downloads Gihub repo dependents Gihub package dependents Node.js CI js-standard-style

@test-runner/core

This documentation is a work in progress.

Isomophic test runner. Takes a test-object-model instance as input, streaming progress info to the attached view or listener. Used by test-runner and web-runner.

Synopsis

This trivial example creates a test object model containing one passing and one failing test. The model is passed to a TestRunnerCore instance, along with the default view, which then runs the tests printing the result to the console.

import TestRunnerCore from '@test-runner/core'
import Tom from '@test-runner/tom'

/* Define a simple test model */
const tom = new Tom()

tom.test('A successful test', function () {
  return 'This passed'
})

tom.test('A failing test', function () {
  throw new Error('This failed')
})

/* send test-runner output to the default view  */
const view = new DefaultView()

/* run the tests defined in the test model */
const runner = new TestRunnerCore(tom, { view })
runner.start()

Output.

$ nodem tmp/synopsis.mjs

Start: 2 tests loaded

 ✓ tom A successful test [This passed]
 ⨯ tom A failing test

   Error: This failed
       at TestContext.<anonymous> (file:///Users/lloyd/Documents/test-runner-js/core/tmp/synopsis.mjs:13:9)
       ...
       at processTimers (internal/timers.js:475:7)


Completed in 11ms. Pass: 1, fail: 1, skip: 0.

Instead of passing a view instance to TestRunnerCore, this example shows how to observe runner events and print your own output.

const runner = new TestRunnerCore(tom)

runner.on('state', (state, prevState) => {
  console.log(`Runner state change: ${prevState} -> ${state}`)
})
runner.on('test-pass', test => {
  console.log(`Test passed: ${test.name}`)
})
runner.on('test-fail', test => {
  console.log(`Test failed: ${test.name}`)
})
runner.start().then(() => {
  console.log(`Test run complete. State: ${runner.state}, passed: ${runner.stats.pass}, failed: ${runner.stats.fail}`)
})

Output.

$ node --experimental-modules synopsis.mjs
Runner state change: pending -> in-progress
Test passed: A successful test
Test failed: A failing test
Runner state change: in-progress -> fail
Test run complete. State: fail, passed: 1, failed: 1

See also


© 2016-21 Lloyd Brookes <[email protected]>. Documented by jsdoc-to-markdown.