JSPM

  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q96728F
  • License BSD-3-Clause

Cross platform Jest Config

Package Exports

  • @times-components/jest-configurator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@times-components/jest-configurator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Jest

Across the components in the monorepo, we reuse Jest config in a number of places. It makes sense to centralise this. As a result the Jest Configurator was created.

Usage

Create a file called jest.config.js in a platform specific folder under tests. E.g. <rootDir>/packages/${component}/__tests__/${platform}/jest.config.js. Then add platform specific code like below.

const jestConfigurator = require("@times-components/jest-configurator");

module.exports = jestConfigurator("android", __dirname);

Saving this file in your platform specific tests folder will give you a platform specific Jest config.