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

meta-test

v0.0.12

Published

framework for writing unit test frameworks

Readme

#Meta-Test (alpha)# ##the test framework framework##

Meta-test does everything that every test framework must do (reporting, sandboxing) and separates it from the things it may do (the test api).

Hence meta-test is a standard runner for multiple test frameworks.

only lightweight adapters are necessary to run any kind of nodejs test, currently expresso, vows, nodeunit, and node tests are supported.

(by 'node' test i mean a simple script which throws an exception if it fails, but has no framework - the simplest kind of test)

current features:

  • run expresso, vows, and nodeunit tests (adapters use a very simple API - easy to add more)
  • run plain node.js scripts which just throw an exception on failure.
  • isolate tests in a separate node process.
  • detect compatibility with node versions by testing in each version (>=0.2.0)
  • test runner detects dependencies & can inject different dependency versions (see -meta and -remaps args)
  • a standard reporting API independent of test framework.

forthcoming:

  • additional test framework adapters, test-commonjs, qunit, mjsunit etc.
  • browser based testing.
  • plugins to detect code coverage, and monkeypatches.

##Support##

this is the alpha release of an ambitious project. Any problems, please do not hesitate to log a issue, email me ([email protected]) or find me in #node.js on irc.freenode.net

##Usuage##

basic

> meta-test -expresso test/an-expresso-test.js   //run an expresso test etc.
> meta-test -nodeunit test/an-expresso-test.js   //run an nodeunit test etc.
> meta-test -node test/script.js                 //a script which throws an exception & exits on fail or error.

set node version of test process. will detect node versions installed by nvm.

> meta-test -version v0.3.8 test/test.expresso.js

detect dependencies

> meta-test -meta test/test.expresso.js

remap dependencies

> meta-test -remaps '{"request": "/path/to/file.js"}' test/test.expresso.js

for more information use meta-test --help

##detecting test adapters.##

###the easy way: use my convention ###

append .[adapter].js to your test filenames.

test/test1.expresso.js   //an expresso test
test/test2.nodeunit.js   //an nodeunit test
test/test3.synct.js      //like simplified expresso, sync functions only.
test/test4.asynct.js     //like simplified nodeunit/async_testing, must declare when test is completed.

###the less easy way:###

meta-test will recursively search ./ , ../ , ../../ , etc looking for a package.json. if the json it finds has an property "test-adapters": ['adapter'] (note adapter must be in an array)

##Test Runner API##

to use npm to run tests programmaticially:

var meta = require('meta-test')

meta.run({
//mandatory
  filename: pathToTest //will need to be relative to meta-test/runner or absolute
, adapter: nameOfAdapter // something from meta-test/adapters directory
//optional
, timeout: maxTimeInMilliseconds //defaults to 30e3 (30 seconds)
, remaps {request, fileToLoadInsteadOf_request
}, callback)

function callback (err,report){
  //do something with the report!
}

##Adapter API##

a test adapter needs just one function, run(tests,reporter,callback) it has just two arguments:

  • tests: whatever the unit test exported
  • reporter: the meta-test report builder.
  • callback: callback when it thinks the test is done.

it must return a shutdown function.

the shutdown function can be used to check that all the tests where run, etc.

the shutdown will be called when the test runner is confidant that the test is complete (i.e. at exit). the shutdown function must be synchronous. this is to allow for weird problems with async tests. (like accidentially declaring the test done)

see meta-test/adapters for examples of using the Adapter API