babel-jest
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -5,6 +5,11 @@ var babel = require("babel-core"); | ||
process: function (src, filename) { | ||
// Allow the stage to be configured by an environment | ||
// variable, but use Babel's default stage (2) if | ||
// no environment variable is specified. | ||
var stage = process.env.BABEL_JEST_STAGE || 2 | ||
// Ignore all files within node_modules | ||
// babel files can be .js, .es, .jsx or .es6 | ||
if (filename.indexOf("node_modules") === -1 && babel.canCompile(filename)) { | ||
return babel.transform(src, { filename: filename }).code; | ||
return babel.transform(src, { filename: filename, stage: stage }).code; | ||
} | ||
@@ -11,0 +16,0 @@ return src; |
{ | ||
"name": "babel-jest", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"repository": "babel/babel-jest", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -31,1 +31,23 @@ # babel-jest | ||
**And you're good to go!** | ||
## Using experimental stages | ||
By default, babel-jest will use Babel's default stage (stage 2). | ||
If you'd like to use one of the other stages, set the environment variable: | ||
`BABEL_JEST_STAGE` | ||
And then you can modify the test command in package.json like so: | ||
```javascript | ||
{ | ||
// Normal pakcage.json stuff, | ||
"scripts": { | ||
"test": "BABEL_JEST_STAGE=0 jest" | ||
}, | ||
// Normal pakcage.json stuff | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2713
15
53
2