Testing JS projects is complicated.
Last updated a year ago by critocrito .
GPL-3.0 · Repository · Original npm · Tarball · package.json
$ cnpm install @build-chores/test 
SYNC missed versions from official npm registry.


Testing JS projects is complicated.


License: GPL v3 npm version Build Status

Use your custom Babel configuration with the AVA test runner and instrument code coverage using nyc.


Install the @build-chores/test package into your project:

yarn install --dev @build-chores/test ava@1.0.0-beta.8

To make use of AVA add the following entry to your package.json. It will use your local .babelrc to compile your source code and use babel-plugin-istanbul to instrument the code. See the example package.json for a template.

  "ava": {
    "require": "@build-chores/test"

ava is declared as a peer dependency. This means it has to be installed along the @build-chores/test package. Make sure to install either ava@1.0.0-beta.8 or ava@next tag. The default ava package installs a very old version.

Configure code coverage by placing a .nycrc in your project root. See the example .nycrc for a template.

  "sourceMap": false,
  "instrument": true,
  "all": true,
  "include": [

Please note that in order for all to work and instrument all source files, instrument has to be set to true.

Provide the test and coverage script targets to your package.json. AVA sets your NODE_ENV to test automatically. See the example package.json for a template.

  "scripts": {
    "test": "ava",
    "test:coverage": "nyc yarn test",
    "test:watch": "yarn test -w"

You are ready to test your files.


Check out our contributing.md to get started.


Current Tags

  • 0.9.0                                ...           latest (a year ago)

4 Versions

  • 0.9.0                                ...           a year ago
  • 0.8.0                                ...           a year ago
  • 0.7.0                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 5
Last Month 0
Dependencies (4)
Dev Dependencies (0)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |