0.4.0 • Published 12 months ago

@langri-sha/projen-jest-config v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@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
0.4.0

12 months ago

0.3.1

12 months ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago