@infinum/jest
v2.0.1
Published
Set of util functions for easier jest setup that supports both server and browser environment.
Downloads
1,613
Keywords
Readme
@infinum/jest
Set of util functions for easier jest setup that supports both server and browser environment.
This is an internal utility, not intended for public usage.
Installation
yarn add @infinum/jest jest
# or
npm i @infinum/jest jest
Usage
Basic
// jest.config.js
const { infinumJest } = require('@infinum/jest');
const createJestConfig = infinumJest();
module.exports = createJestConfig();
With custom config
// jest.config.js
const { infinumJest } = require('@infinum/jest');
const createJestConfig = infinumJest();
/** @type {import('jest').Config} */
const customConfig = {
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
};
module.exports = createJestConfig(customConfig);
With @infinum/jest/environment
// jest.config.js
const { infinumJest } = require('@infinum/jest');
const createJestConfig = infinumJest();
/** @type {import('jest').Config} */
const customConfig = {
testEnvironment: '@infinum/jest/environment',
};
module.exports = createJestConfig(customConfig);
Contribution
Yes please! See the contributing guidelines for details.
Licence
This project is licensed under the terms of the MIT license.
Credits
jest
is maintained and sponsored by
Infinum.