0.8.5 • Published 2 years ago
@optimics/jest v0.8.5
lerna-jest
Oversimplify jest configuration for common use cases.
Install
npm install -d jest lerna-jestConfigure
- Create file
jest.config.jsin your lerna root.
import { guessRootConfig } from '@optimics/jest'
module.exports = guessRootConfig(import.meta.url)- 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 -- --watchMagic 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.jsgoes in setupFiles.jest.afterEnv.jsgoes in setupFilesAfterEnv
Magic plugins
Some plugins are automatically recognized, you only need to install them: