Skip to main content

Jest driver

Provides Jest support by dynamically generating a jest.config.js config file.

Requirements#

  • Jest ^26.0.0 || ^27.0.0.

Installation#

In your configuration module, install the driver, Jest, and Babel (if required).

yarn add @beemo/driver-jest jest

Create a file at configs/jest.ts (or js) in which to house your Jest configuration.

configs/jest.ts
import { JestConfig } from '@beemo/driver-jest';
const config: JestConfig = {
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
// ...
};
export default config;

Integration#

In your consuming project, enable the driver by adding jest to your drivers config.

.config/beemo.ts
import { BeemoConfig } from '@beemo/core';
const config: BeemoConfig = {
module: '<config-module>',
drivers: ['jest'],
};
export default config;