This package has been deprecated

Author message:

jest-babel is outdated and useless now, try to move to babel-jest package

jest-babel

1.0.1 • Public • Published

Simple Babel preprocessor for Jest

Usage

Install the package:

$ npm install jest-babel --save-dev

Add preprocessor to your package.json:

{
  "scripts": {
    "test": "jest"
  },
  "jest": {
    "scriptPreprocessor": "<rootDir>/node_modules/jest-babel",
    "preprocessorIgnorePatterns": ["/node_modules/"],
    "testFileExtensions": ["es6", "js"],
    "moduleFileExtensions": ["js", "json", "es6"]
  }
}

If you want to transpile your dependencies, you can skip the key preprocessorIgnorePatterns.

Extending default config

By default babel will transform your code with this config:

{
  "stage": 2,
  "retainLines": true,
  "auxiliaryCommentBefore": "istanbul ignore next"
}

You can override or extend it with jest-babel section in your package.json:

{
  "jest-babel": {
    "stage": 1,
    "extensions": ["es6", "customext"]
  }
}

Package Sidebar

Install

npm i jest-babel

Weekly Downloads

1,731

Version

1.0.1

License

MIT

Last publish

Collaborators

  • silent