[go: up one dir, main page]

Skip to content

A Jest plugin for optimized integration with Webpack, Babel and React

License

Notifications You must be signed in to change notification settings

LarsOL/jest-babel-webpack-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jest-babel-webpack-react

A Jest plugin for optimized integration with Webpack, Babel and React

This plugin assumes you already have a valid babel instance installed, and unlike babel-jest will use the projects .babelrc file.

It will skip files that babel can not compile, such as .less, .css, .png etc..

It will skip transforming /node_module/ files, under the assumption that they are already valid es5.

It will skip including the jsx transformer (react) on js files for a significant performance advantage.

Files not meeting any of this criteria will be transformed as per .babelrc file.

Installation

$ npm install jest-babel-webpack-react --save-dev

Usage

Insert jest.scriptPreprocessor in package.json:

{
  "jest": {
    "scriptPreprocessor": "<rootDir>/node_modules/jest-babel-webpack-react"
  }
}

For convenience you may want to add in package.json:

"scripts": {
    "test": "jest"
  }

Then run the tests with npm test

About

A Jest plugin for optimized integration with Webpack, Babel and React

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published