Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/helper-transform-fixture-test-runner

Package Overview
Dependencies
Maintainers
6
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-transform-fixture-test-runner - npm Package Compare versions

Comparing version 7.12.17 to 7.13.0

51

lib/index.js

@@ -33,4 +33,2 @@ "use strict";

var _jestDiff = _interopRequireDefault(require("jest-diff"));
var _escapeRegexp = _interopRequireDefault(require("./escape-regexp"));

@@ -249,4 +247,4 @@

if (validateLogs) {
validateFile(normalizeOutput(actualLogs.stdout), stdout.loc, stdout.code);
validateFile(normalizeOutput(actualLogs.stderr), stderr.loc, stderr.code);
validateFile(normalizeOutput(actualLogs.stdout, true), stdout.loc, stdout.code);
validateFile(normalizeOutput(actualLogs.stderr, true), stderr.loc, stderr.code);
}

@@ -290,3 +288,3 @@ }

function normalizeOutput(code) {
function normalizeOutput(code, normalizePathSeparator) {
const projectRoot = _path.default.resolve(__dirname, "../../../");

@@ -299,2 +297,6 @@

result = result.replace(new RegExp((0, _escapeRegexp.default)(projectRoot.replace(/\\/g, "/")), "g"), cwdSymbol).replace(new RegExp((0, _escapeRegexp.default)(projectRoot.replace(/\\/g, "\\\\")), "g"), cwdSymbol);
if (normalizePathSeparator) {
result = result.replace(/<CWD>[\w\\/.-]+/g, path => path.replace(/\\\\?/g, "/"));
}
}

@@ -305,20 +307,25 @@

const toEqualFile = (actual, {
filename,
code
}) => {
const pass = actual === code;
return {
pass,
message: pass ? () => {
expect.extend({
toEqualFile(actual, {
filename,
code
}) {
if (this.isNot) {
throw new Error(".toEqualFile does not support negation");
} : () => {
const diffString = (0, _jestDiff.default)(code, actual, {
expand: false
});
return `Expected ${filename} to match transform output.\n` + `To autogenerate a passing version of this file, delete the file and re-run the tests.\n\n` + `Diff:\n\n${diffString}`;
}
};
};
const pass = actual === code;
return {
pass,
message: () => {
const diffString = this.utils.diff(code, actual, {
expand: false
});
return `Expected ${filename} to match transform output.\n` + `To autogenerate a passing version of this file, delete the file and re-run the tests.\n\n` + `Diff:\n\n${diffString}`;
}
};
}
});
function _default(fixturesLoc, name, suiteOpts = {}, taskOpts = {}, dynamicOpts) {

@@ -332,6 +339,2 @@ const suites = (0, _helperFixtures.default)(fixturesLoc);

describe(name + "/" + testSuite.title, function () {
expect.extend({
toEqualFile
});
for (const task of testSuite.tests) {

@@ -338,0 +341,0 @@ var _suiteOpts$ignoreTask, _suiteOpts$ignoreTask2;

{
"name": "@babel/helper-transform-fixture-test-runner",
"version": "7.12.17",
"version": "7.13.0",
"description": "Transform test runner for @babel/helper-fixtures module",

@@ -19,6 +19,5 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

"@babel/code-frame": "^7.12.13",
"@babel/core": "^7.12.17",
"@babel/helper-fixtures": "^7.12.13",
"@babel/core": "^7.13.0",
"@babel/helper-fixtures": "^7.13.0",
"babel-check-duplicated-nodes": "^1.0.0",
"jest-diff": "^24.8.0",
"lodash": "^4.17.19",

@@ -25,0 +24,0 @@ "quick-lru": "5.1.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