https://github.com/ofhouse/jest-project-babel-transformer
Example of how to use Jest project runner with individual babelrc config
https://github.com/ofhouse/jest-project-babel-transformer
example javascript jest typescript
Last synced: 4 months ago
JSON representation
Example of how to use Jest project runner with individual babelrc config
- Host: GitHub
- URL: https://github.com/ofhouse/jest-project-babel-transformer
- Owner: ofhouse
- License: mit
- Created: 2019-08-23T09:49:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-14T17:34:11.000Z (about 5 years ago)
- Last Synced: 2024-12-10T14:28:46.116Z (5 months ago)
- Topics: example, javascript, jest, typescript
- Language: JavaScript
- Homepage:
- Size: 153 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jest multi project runner with babel-jest [](https://travis-ci.org/ofhouse/jest-project-babel-transformer)
This is an example of how to use the [`babel-jest`](https://www.npmjs.com/package/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:
```sh
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
```sh
# Install dependencies
yarn# Run all tests from workspace root
yarn test# Run tests in a workspace
cd fixtures/react
yarn test
```## Author
| [
Felix Haus](https://github.com/ofhouse)
[Website](https://felix.house/) • [Twitter](https://twitter.com/ofhouse)|
| :---: |## License
MIT - see [LICENSE](./LICENSE) for details.