Assertions for any JavaScript test framework and environment

npm install referee
23 downloads in the last day
413 downloads in the last week
1 650 downloads in the last month


Build status

referee is in your unit tests, deciding who passes and who fails.

It is a test-framework agnostic assertion and expectation library. Some highlights:

  • Rich library of assertions
  • Symmetric assert/refute (refute is referee's "assert.not*")
  • Evented: Emits success and failure events
  • Failing assertions throw exceptions by default, but can be configured to not
  • API to add custom assertions that provides quite a bit of plumbing for free

Full documentation:

referee works in browsers (including old and rowdy ones, like IE6) and Node. It will define itself as an AMD module if you want it to (i.e. if there's a define function available).

Developers - Running tests


  1. npm install - installs dev dependencies
  2. npm test - runs node tests


  1. npm install - installs dev dependencies
  2. npm start - starts buster server
  3. open url localhost:1111/capture in the browser(s) you want to test with
  4. npm run-script test-browser - runs browser tests
npm loves you