npm install --save-dev start-jest
# or
yarn add --dev start-jest
import Start from 'start';
import reporter from 'start-pretty-reporter';
import env from 'start-env';
import jest from 'start-jest';
const start = Start(reporter());
export const test = () => start(
env('NODE_ENV', 'test'),
jest({
moduleNameMapper: {
'^~/(.*)$': '<rootDir>/packages/$1'
},
roots: [
'<rootDir>/packages/neoform/'
],
testMatch: [
'**/tests/*.jsx'
],
collectCoverage: true,
collectCoverageFrom: [
'**/src/*.jsx'
],
coverageReporters: [
'lcov',
'text-summary'
],
snapshotSerializers: [
'enzyme-to-json/serializer'
]
})
);
jest(options)
options
– Jest CLI options
💁 { config: '.jestrc' }