@babel/helper-transform-fixture-test-runner
Advanced tools
Comparing version 7.12.17 to 7.13.0
@@ -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", |
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
15089
8
318
- Removedjest-diff@^24.8.0
- Removed@jest/types@24.9.0(transitive)
- Removed@types/istanbul-lib-coverage@2.0.6(transitive)
- Removed@types/istanbul-lib-report@3.0.3(transitive)
- Removed@types/istanbul-reports@1.1.2(transitive)
- Removed@types/yargs@13.0.12(transitive)
- Removed@types/yargs-parser@21.0.3(transitive)
- Removedansi-regex@4.1.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removeddiff-sequences@24.9.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedjest-diff@24.9.0(transitive)
- Removedjest-get-type@24.9.0(transitive)
- Removedpretty-format@24.9.0(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedsupports-color@5.5.0(transitive)
Updated@babel/core@^7.13.0