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 16.1.0-alpha.691b0e22 to 17.0.0

44

build/index.js

@@ -17,4 +17,33 @@ /**

const babel = require('babel-core');
const crypto = require('crypto');
const fs = require('fs');
const jestPreset = require('babel-preset-jest');
const path = require('path');
const BABELRC_FILENAME = '.babelrc';
const cache = Object.create(null);
const getBabelRC = (filename, _ref) => {let useCache = _ref.useCache;
const paths = [];
let directory = filename;
while (directory !== (directory = path.dirname(directory))) {
if (useCache && cache[directory]) {
break;
}
paths.push(directory);
const configFilePath = path.join(directory, BABELRC_FILENAME);
if (fs.existsSync(configFilePath)) {
cache[directory] = fs.readFileSync(configFilePath, 'utf8');
break;
}
}
paths.forEach(directoryPath => {
cache[directoryPath] = cache[directory];
});
return cache[directory] || '';
};
const createTransformer = options => {

@@ -49,2 +78,17 @@ options = Object.assign({}, options, {

return src;
},
getCacheKey(
fileData,
filename,
configString, _ref2)
{let instrument = _ref2.instrument,watch = _ref2.watch;
return crypto.createHash('md5').
update(fileData).
update(configString)
// Don't use the in-memory cache in watch mode because the .babelrc
// file may be modified.
.update(getBabelRC(filename, { useCache: !watch })).
update(instrument ? 'instrument' : '').
digest('hex');
} };

@@ -51,0 +95,0 @@

4

package.json
{
"name": "babel-jest",
"version": "16.1.0-alpha.691b0e22",
"version": "17.0.0",
"repository": {

@@ -13,4 +13,4 @@ "type": "git",

"babel-plugin-istanbul": "^2.0.0",
"babel-preset-jest": "^16.1.0-alpha.691b0e22"
"babel-preset-jest": "^16.0.0"
}
}
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