jest-babel

Simple Babel preprocessor for Jest

jest-babel is outdated and useless now, try to move to babel-jest package
Last updated 10 years ago by silent .
MIT · Repository · Bugs · Original npm
$ cnpm install jest-babel 
SYNC missed versions from official npm registry.

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"]
  }
}

Current Tags

  • 1.0.1                                ...           latest (10 years ago)

1 Versions

  • 1.0.1 [deprecated]           ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org