gherkin-jest
gherkin-jest copied to clipboard
Adding your own preprocessor config
Maybe add an example of adding your own preprocessor config to the docs ?
preproccesor.js
:
module.exports = require('babel-jest').createTransformer({
"plugins": ["transform-es2015-modules-commonjs"]
});
package.json
:
"jest": {
"transform": {
"^.+\\.js$": "<rootDir>/preprocessor.js",
"^.+\\.feature$": "gherkin-jest"
},
What does this do?
updated syntax
transform: {
"^.+\\.js$": "babel-jest",
"^.+\\.feature$": "gherkin-jest"
},
- Allows non.feature file tests written in babel to run parallel to feature
I agree that this would be helpful. It took me a while to figure out why babel stopped working for my other tests after adding the transform for gherkin-jest.