Skip to main content

Test runner integration

Basic capabilities of Earl should work in all test runners. If you're not using snapshot tests, feel free to skip this.

Currently, we support integrations with mocha and uvu.


Add 'earljs/mocha' to require array in your .mocharc.js:

module.exports = {
require: ['earljs/mocha'],

Alternatively, you can require earljs/mocha in your test command:

$ mocha -r earljs/mocha


Require earljs/uvu in your test command:

# using the uvu cli
$ uvu -r earljs/uvu tests

# using node directly
$ node -r earljs/uvu tests/example.test.js

That's it!