@langri-sha/projen-jest-config
v0.4.0
Published
A [projen] component for authoring [Jest] configurations. This component is suitable for monorepos and offers support for extending from an existing Jest configuration.
Downloads
1
Readme
@langri-sha/projen-jest-config
A projen component for authoring Jest configurations. This component is suitable for monorepos and offers support for extending from an existing Jest configuration.
Usage
Install required dependencies:
npm install -D jest @langri-sha/projen-jest-config
Configure Jest for your project:
// .projenrc.ts
import { Project } from 'projen'
import { JestConfig } from '@langri-sha/projen-jest-config'
const project = new Project({
name: 'my-project',
})
new JestConfig(project, {
// Configure the desired Jest configuration module. Optional.
filename: 'jest.config.ts',
// Choose a desired Jest configuration module. Optional.
extends: '@langri-sha/jest-config',
// Inline your preferred configuration overrides.
config: {
testEnvironment: 'node',
},
})
This should produce the following output:
// jest.config.ts
import type { Config } from 'jest'
import defaults from '@langri-sha/jest-config'
const config: Config = {
...defaults,
testEnvironment: 'node',
}
export default config