Konsi / jest-project-babel-transformer

Example of how to use Jest project runner with individual babelrc config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jest multi project runner with babel-jest Build status

This is an example of how to use the babel-jest transformer in a monorepo where each package uses its own .babelrc.js configuration-file. This is especially useful when the projects in your workspace do not share the same babel-preset or plugins but you still want to use the multi runner to run all test in your monorepo.

Structure

The structure of this repository is as follows:

fixtures/
├── angular-js/        # Workspace 1
│   ├── .babelrc.js
│   ├── jest.config.js
│   └── package.json
└── react/             # Workspace 2
    ├── .babelrc.js
    ├── jest.config.js
    └── package.json
jest.config.js         # Workspace root
package.json

The tests can be run from the workspace root, which uses the jest projects config or individually from each package which uses the local jest config from each project.

Setup & Test

# Install dependencies
yarn

# Run all tests from workspace root
yarn test

# Run tests in a workspace
cd fixtures/react
yarn test

Author


Felix Haus

WebsiteTwitter

License

MIT - see LICENSE for details.

About

Example of how to use Jest project runner with individual babelrc config

License:MIT License


Languages

Language:JavaScript 50.1%Language:TypeScript 46.9%Language:HTML 3.0%