Skip to content

babel-jest that correctly uses .babelrc files

Notifications You must be signed in to change notification settings

evite/babel-jest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

evite-babel-jest

This is a fork of the Babel jest plugin.

Even though the original package provides the filename option to babel.transform, we still have problems with Babel transforming some of our module filenames.

According to this issue, adding filename to options should be sufficient, but we've found that only by using the transformFileSync API will Babel accurately pick up .babelrc in all cases.

Usage

If you are already using jest-cli, just add evite-babel-jest and it will automatically compile JavaScript code using babel.

yarn add --dev evite-babel-jest babel-core

Note: If you are using babel version 7 you have to install evite-babel-jest with

yarn add --dev evite-babel-jest 'babel-core@^7.0.0-0' @babel/core

If you would like to write your own preprocessor, uninstall and delete evite-babel-jest and set the config.transform option to your preprocessor.

Setup

To add evite-babel-jest as a transformer for your JavaScript code, map .js files to the evite-babel-jest module.

"transform": {
  "^.+\\.jsx?$": "evite-babel-jest"
},

About

babel-jest that correctly uses .babelrc files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published