jest-snapshot
Advanced tools
Comparing version 17.0.3 to 18.0.0
@@ -65,4 +65,4 @@ /** | ||
const toMatchSnapshot = function (received, expected) { | ||
this.dontThrow();const | ||
const toMatchSnapshot = function (received, testName) { | ||
this.dontThrow && this.dontThrow();const | ||
@@ -77,4 +77,2 @@ currentTestName = this.currentTestName,isNot = this.isNot,snapshotState = this.snapshotState; | ||
ensureNoExpected(expected, '.toMatchSnapshot'); | ||
if (!snapshotState) { | ||
@@ -84,3 +82,3 @@ throw new Error('Jest: snapshot state must be initialized.'); | ||
const result = snapshotState.match(currentTestName, received);const | ||
const result = snapshotState.match(testName || currentTestName, received);const | ||
pass = result.pass; | ||
@@ -93,3 +91,2 @@ | ||
const expectedString = expected.trim(); | ||
@@ -107,5 +104,4 @@ const actualString = actual.trim(); | ||
const message = | ||
() => matcherHint('.toMatchSnapshot', 'value', '') + '\n\n' + | ||
`${ RECEIVED_COLOR('Received value') } does not match ` + | ||
const report = | ||
() => `${ RECEIVED_COLOR('Received value') } does not match ` + | ||
`${ EXPECTED_COLOR('stored snapshot ' + count) }.\n\n` + ( | ||
@@ -117,3 +113,7 @@ diffMessage || | ||
return { message, pass: false }; | ||
const message = | ||
() => matcherHint('.toMatchSnapshot', 'value', '') + '\n\n' + | ||
report(); | ||
return { message, pass: false, report }; | ||
} | ||
@@ -123,3 +123,3 @@ }; | ||
const toThrowErrorMatchingSnapshot = function (received, expected) { | ||
this.dontThrow();const | ||
this.dontThrow && this.dontThrow();const | ||
isNot = this.isNot; | ||
@@ -126,0 +126,0 @@ |
@@ -14,4 +14,4 @@ /** | ||
const ReactElementPlugin = require('pretty-format/plugins/ReactElement'); | ||
const ReactTestComponentPlugin = require('pretty-format/plugins/ReactTestComponent'); | ||
const ReactElementPlugin = require('pretty-format/build/plugins/ReactElement'); | ||
const ReactTestComponentPlugin = require('pretty-format/build/plugins/ReactTestComponent'); | ||
@@ -18,0 +18,0 @@ let PLUGINS = [ReactElementPlugin, ReactTestComponentPlugin]; |
@@ -63,2 +63,3 @@ /** | ||
return addExtraLineBreaks(prettyFormat(data, { | ||
escapeRegex: true, | ||
plugins: getPlugins(), | ||
@@ -65,0 +66,0 @@ printFunctionName: false })); |
{ | ||
"name": "jest-snapshot", | ||
"version": "17.0.3", | ||
"version": "18.0.0", | ||
"repository": { | ||
@@ -11,8 +11,8 @@ "type": "git", | ||
"dependencies": { | ||
"jest-diff": "^17.0.3", | ||
"jest-diff": "^18.0.0", | ||
"jest-file-exists": "^17.0.0", | ||
"jest-matcher-utils": "^17.0.3", | ||
"jest-util": "^17.0.2", | ||
"jest-matcher-utils": "^18.0.0", | ||
"jest-util": "^18.0.0", | ||
"natural-compare": "^1.4.0", | ||
"pretty-format": "~4.2.1" | ||
"pretty-format": "^18.0.0" | ||
}, | ||
@@ -19,0 +19,0 @@ "scripts": { |
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
12126
339
+ Addedjest-diff@18.1.0(transitive)
+ Addedjest-matcher-utils@18.1.0(transitive)
+ Addedjest-mock@18.0.0(transitive)
+ Addedjest-util@18.1.0(transitive)
+ Addedpretty-format@18.1.0(transitive)
- Removedjest-diff@17.0.3(transitive)
- Removedjest-matcher-utils@17.0.3(transitive)
- Removedjest-mock@17.0.2(transitive)
- Removedjest-util@17.0.2(transitive)
- Removedpretty-format@4.2.3(transitive)
Updatedjest-diff@^18.0.0
Updatedjest-matcher-utils@^18.0.0
Updatedjest-util@^18.0.0
Updatedpretty-format@^18.0.0