jest-snapshot
Advanced tools
Comparing version 13.1.0 to 13.1.1
@@ -42,3 +42,4 @@ /** | ||
const escape = string => string.replace(/\`/g, '\\`'); | ||
const escape = string => string.replace(/\`/g, '\\\`'); | ||
const unescape = string => string.replace(/\\(\"|\\)/g, '$1'); | ||
@@ -109,10 +110,7 @@ // Extra line breaks at the beginning and at the end of the snapshot are useful | ||
if ((this._dirty || this._uncheckedKeys.size) && !isEmpty) { | ||
const snapshots = []; | ||
for (const key in this._content) { | ||
const item = this._content[key]; | ||
snapshots.push( | ||
'exports[`' + escape(key) + '`] = `' + escape(item) + '`;');} | ||
const snapshots = Object.keys(this._content).sort().map(key => | ||
'exports[`' + escape(key) + '`] = `' + | ||
escape(this._content[key]) + '`;'); | ||
ensureDirectoryExists(this._filename); | ||
@@ -141,3 +139,3 @@ fs.writeFileSync(this._filename, snapshots.join('\n\n') + '\n'); | ||
this._uncheckedKeys.delete(key); | ||
const actual = this.serialize(value); | ||
const actual = unescape(this.serialize(value)); | ||
const expected = this.get(key); | ||
@@ -144,0 +142,0 @@ return { |
{ | ||
"name": "jest-snapshot", | ||
"version": "13.1.0", | ||
"version": "13.1.1", | ||
"repository": { | ||
@@ -11,4 +11,4 @@ "type": "git", | ||
"dependencies": { | ||
"jest-util": "^13.1.0", | ||
"pretty-format": "^3.4.1" | ||
"jest-util": "^13.1.1", | ||
"pretty-format": "^3.4.3" | ||
}, | ||
@@ -15,0 +15,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
9167
240
Updatedjest-util@^13.1.1
Updatedpretty-format@^3.4.3