# lerna-jest

> Fun to use jest configurator compatible with lerna

Latest version **0.11.1** (published 2023-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install lerna-jest
pnpm add lerna-jest
yarn add lerna-jest
bun add lerna-jest
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.11.1 |
| Published | 2023-06-07 |
| First published | 2021-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | just-paja |
| Maintainers | just-paja |
| Keywords | jest, configure, test, lerna |

## Links

- npm: https://www.npmjs.com/package/lerna-jest
- Repository: https://github.com/just-paja/lerna-jest
- Homepage: https://github.com/just-paja/lerna-jest/tree/master/packages/jest#readme
- Issues: https://github.com/just-paja/lerna-jest/issues
- npm.io page: https://npm.io/package/lerna-jest

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.11.1 (latest) — 2023-06-07
- 0.11.0 — 2023-06-07
- 0.10.0 — 2023-03-23
- 0.9.0 — 2023-02-01
- 0.8.0 — 2023-01-23
- 0.7.0 — 2023-01-03
- 0.6.3 — 2022-12-22
- 0.6.2 — 2022-12-22
- 0.6.1 — 2022-12-22
- 0.6.0 — 2022-12-22
- 0.5.7 — 2022-11-23
- 0.5.6 — 2022-10-21
- 0.5.4 — 2021-02-25
- 0.3.0 — 2021-02-22
- 0.2.2 — 2021-01-24
- … 4 more at https://npm.io/package/lerna-jest/versions

## README

# `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)
```

2. 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:

* `jest.setup.js` goes in [setupFiles](https://jestjs.io/docs/en/configuration#setupfiles-array).
* `jest.afterEnv.js` goes in [setupFilesAfterEnv](https://jestjs.io/docs/en/configuration#setupfilesafterenv-array)

## Magic plugins

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

* [jest-date-mock](https://www.npmjs.com/package/jest-date-mock)
* [jest-enzyme](https://www.npmjs.com/package/jest-enzyme)
* [jest-extended](https://www.npmjs.com/package/jest-extended)
* [jest-runner-eslint](https://www.npmjs.com/package/jest-runner-eslint)
* [jest-runner-standard](https://www.npmjs.com/package/jest-runner-standard)
* [jest-watch-select-projects](https://www.npmjs.com/package/jest-watch-select-projects)
* [jest-watch-typeahead](https://www.npmjs.com/package/jest-watch-typeahead)

---
_Source: https://npm.io/package/lerna-jest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
