npm.io
0.11.1 • Published 3 years ago

lerna-jest

Licence
MIT
Version
0.11.1
Deps
0
Size
10 kB
Vulns
0
Weekly
0
Stars
3

lerna-jest

Oversimplify jest configuration for common use cases.

Install

npm install -d jest lerna-jest

Configure

  1. Create file jest.config.js in your lerna root.
const { guessRootConfig } = require('lerna-jest')
module.exports = guessRootConfig(__dirname)
  1. Configure test script in lerna root package.json.
{
  "scripts": {
    "test": "jest"
  }
}

If you fit the common use cases = you've got some tests and a linter, then you're done for all of your projects. Now you can just use common npm interface to run tests.

npm test -- --watch

Magic setup files

Create these files on the lerna root level or inside the project and they will be automatically used to configure jest environment:

Magic plugins

Some plugins are automatically recognized, you only need to install them:

Keywords