Socket
Socket
Sign inDemoInstall

babel-jest

Package Overview
Dependencies
Maintainers
5
Versions
280
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-jest - npm Package Compare versions

Comparing version 18.0.0 to 18.5.0-alpha.7da3df39

35

build/index.js

@@ -16,3 +16,2 @@ /**

const babel = require('babel-core');
const crypto = require('crypto');

@@ -24,5 +23,8 @@ const fs = require('fs');

const BABELRC_FILENAME = '.babelrc';
const THIS_FILE = fs.readFileSync(__filename);
const cache = Object.create(null);
let babel;
const getBabelRC = (filename, _ref) => {let useCache = _ref.useCache;

@@ -52,3 +54,3 @@ const paths = [];

options = Object.assign({}, options, {
auxiliaryCommentBefore: ' istanbul ignore next ',
plugins: options && options.plugins || [],
presets: (options && options.presets || []).concat([jestPreset]),

@@ -58,2 +60,3 @@ retainLines: true });

delete options.cacheDirectory;
delete options.filename;

@@ -69,7 +72,12 @@ return {

return crypto.createHash('md5').
update(THIS_FILE).
update('\0', 'utf8').
update(fileData).
update(configString)
update('\0', 'utf8').
update(configString).
update('\0', 'utf8')
// Don't use the in-memory cache in watch mode because the .babelrc
// file may be modified.
.update(getBabelRC(filename, { useCache: !watch })).
update('\0', 'utf8').
update(instrument ? 'instrument' : '').

@@ -84,7 +92,16 @@ digest('hex');

{
let plugins = options.plugins || [];
if (!babel) {
babel = require('babel-core');
}
if (!babel.util.canCompile(filename)) {
return src;
}
const theseOptions = Object.assign({ filename }, options);
if (transformOptions && transformOptions.instrument) {
theseOptions.auxiliaryCommentBefore = ' istanbul ignore next ';
// Copied from jest-runtime transform.js
plugins = plugins.concat([
theseOptions.plugins = theseOptions.plugins.concat([
[

@@ -101,9 +118,3 @@ require('babel-plugin-istanbul').default,

if (babel.util.canCompile(filename)) {
return babel.transform(
src,
Object.assign({}, options, { filename, plugins })).
code;
}
return src;
return babel.transform(src, theseOptions).code;
} };

@@ -110,0 +121,0 @@

{
"name": "babel-jest",
"version": "18.0.0",
"version": "18.5.0-alpha.7da3df39",
"repository": {

@@ -12,5 +12,5 @@ "type": "git",

"babel-core": "^6.0.0",
"babel-plugin-istanbul": "^3.0.0",
"babel-preset-jest": "^18.0.0"
"babel-plugin-istanbul": "^4.0.0",
"babel-preset-jest": "^18.5.0-alpha.7da3df39"
}
}

@@ -23,4 +23,4 @@ # babel-jest

"transform": {
"^.+\\.js$": "<rootDir>/node_modules/babel-jest"
"^.+\\.jsx?$": "babel-jest"
},
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc