@babel/helper-transform-fixture-test-runner
Advanced tools
Comparing version 7.12.13 to 7.12.17
@@ -104,3 +104,3 @@ "use strict"; | ||
function runModuleInTestContext(id, relativeFilename, context, moduleCache) { | ||
const filename = (parseFloat(process.versions.node) >= 8.9 ? require.resolve : (r, { | ||
const filename = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, { | ||
paths: [b] | ||
@@ -302,22 +302,19 @@ }, M = require("module")) => { | ||
const toEqualFile = () => ({ | ||
compare: (actual, { | ||
filename, | ||
code | ||
}) => { | ||
const pass = actual === code; | ||
return { | ||
pass, | ||
message: () => { | ||
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}`; | ||
} | ||
}; | ||
}, | ||
negativeCompare: () => { | ||
throw new Error("Negation unsupported"); | ||
} | ||
}); | ||
const toEqualFile = (actual, { | ||
filename, | ||
code | ||
}) => { | ||
const pass = actual === code; | ||
return { | ||
pass, | ||
message: pass ? () => { | ||
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}`; | ||
} | ||
}; | ||
}; | ||
@@ -332,3 +329,3 @@ function _default(fixturesLoc, name, suiteOpts = {}, taskOpts = {}, dynamicOpts) { | ||
describe(name + "/" + testSuite.title, function () { | ||
jest.addMatchers({ | ||
expect.extend({ | ||
toEqualFile | ||
@@ -335,0 +332,0 @@ }); |
{ | ||
"name": "@babel/helper-transform-fixture-test-runner", | ||
"version": "7.12.13", | ||
"version": "7.12.17", | ||
"description": "Transform test runner for @babel/helper-fixtures module", | ||
@@ -19,3 +19,3 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"@babel/code-frame": "^7.12.13", | ||
"@babel/core": "^7.12.13", | ||
"@babel/core": "^7.12.17", | ||
"@babel/helper-fixtures": "^7.12.13", | ||
@@ -22,0 +22,0 @@ "babel-check-duplicated-nodes": "^1.0.0", |
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
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
15034
316
Updated@babel/core@^7.12.17