jest-snapshot
Advanced tools
Comparing version 29.0.0 to 29.0.1
@@ -11,5 +11,5 @@ /** | ||
import type {MatcherFunctionWithContext} from 'expect'; | ||
import type {OptionsReceived} from 'pretty-format'; | ||
import {Plugin as Plugin_2} from 'pretty-format'; | ||
import {Plugins} from 'pretty-format'; | ||
import type {PrettyFormatOptions} from 'pretty-format'; | ||
@@ -50,2 +50,4 @@ export declare const addSerializer: (plugin: Plugin_2) => void; | ||
declare type SnapshotFormat = Omit<PrettyFormatOptions, 'compareKeys'>; | ||
export declare interface SnapshotMatchers<R extends void | Promise<void>, T> { | ||
@@ -92,8 +94,8 @@ /** | ||
declare type SnapshotMatchOptions = { | ||
testName: string; | ||
received: unknown; | ||
key?: string; | ||
inlineSnapshot?: string; | ||
isInline: boolean; | ||
error?: Error; | ||
readonly testName: string; | ||
readonly received: unknown; | ||
readonly key?: string; | ||
readonly inlineSnapshot?: string; | ||
readonly isInline: boolean; | ||
readonly error?: Error; | ||
}; | ||
@@ -111,7 +113,7 @@ | ||
declare type SnapshotReturnOptions = { | ||
actual: string; | ||
count: number; | ||
expected?: string; | ||
key: string; | ||
pass: boolean; | ||
readonly actual: string; | ||
readonly count: number; | ||
readonly expected?: string; | ||
readonly key: string; | ||
readonly pass: boolean; | ||
}; | ||
@@ -123,11 +125,11 @@ | ||
private _index; | ||
private _updateSnapshot; | ||
private readonly _updateSnapshot; | ||
private _snapshotData; | ||
private _initialData; | ||
private _snapshotPath; | ||
private readonly _initialData; | ||
private readonly _snapshotPath; | ||
private _inlineSnapshots; | ||
private _uncheckedKeys; | ||
private _prettierPath; | ||
private _snapshotFormat; | ||
private _rootDir; | ||
private readonly _uncheckedKeys; | ||
private readonly _prettierPath; | ||
private readonly _rootDir; | ||
readonly snapshotFormat: SnapshotFormat; | ||
added: number; | ||
@@ -158,7 +160,7 @@ expand: boolean; | ||
declare type SnapshotStateOptions = { | ||
updateSnapshot: Config.SnapshotUpdateState; | ||
prettierPath?: string | null; | ||
expand?: boolean; | ||
snapshotFormat: OptionsReceived; | ||
rootDir: string; | ||
readonly updateSnapshot: Config.SnapshotUpdateState; | ||
readonly prettierPath?: string | null; | ||
readonly expand?: boolean; | ||
readonly snapshotFormat: SnapshotFormat; | ||
readonly rootDir: string; | ||
}; | ||
@@ -165,0 +167,0 @@ |
@@ -482,3 +482,4 @@ 'use strict'; | ||
received, | ||
snapshotState.expand | ||
snapshotState.expand, | ||
snapshotState.snapshotFormat | ||
)}`; // Passing the actual and expected objects so that a custom reporter | ||
@@ -485,0 +486,0 @@ // could access them, for example in order to display a custom visual diff, |
@@ -274,8 +274,3 @@ 'use strict'; | ||
const printSnapshotAndReceived = ( | ||
a, | ||
b, | ||
received, | ||
expand // CLI options: true if `--expand` or false if `--no-expand` | ||
) => { | ||
const printSnapshotAndReceived = (a, b, received, expand, snapshotFormat) => { | ||
const aAnnotation = 'Snapshot'; | ||
@@ -355,3 +350,3 @@ const bAnnotation = 'Received'; | ||
const b0 = (0, _utils.serialize)(received, 0); | ||
const b0 = (0, _utils.serialize)(received, 0, snapshotFormat); | ||
@@ -358,0 +353,0 @@ if (b0 !== b) { |
@@ -75,4 +75,4 @@ 'use strict'; | ||
_prettierPath; | ||
_snapshotFormat; | ||
_rootDir; | ||
snapshotFormat; | ||
added; | ||
@@ -104,3 +104,3 @@ expand; | ||
this.updated = 0; | ||
this._snapshotFormat = options.snapshotFormat; | ||
this.snapshotFormat = options.snapshotFormat; | ||
this._rootDir = options.rootDir; | ||
@@ -221,3 +221,3 @@ } | ||
const receivedSerialized = (0, _utils.addExtraLineBreaks)( | ||
(0, _utils.serialize)(received, undefined, this._snapshotFormat) | ||
(0, _utils.serialize)(received, undefined, this.snapshotFormat) | ||
); | ||
@@ -224,0 +224,0 @@ const expected = isInline ? inlineSnapshot : this._snapshotData[key]; |
{ | ||
"name": "jest-snapshot", | ||
"version": "29.0.0", | ||
"version": "29.0.1", | ||
"repository": { | ||
@@ -26,5 +26,5 @@ "type": "git", | ||
"@babel/types": "^7.3.3", | ||
"@jest/expect-utils": "^29.0.0", | ||
"@jest/transform": "^29.0.0", | ||
"@jest/types": "^29.0.0", | ||
"@jest/expect-utils": "^29.0.1", | ||
"@jest/transform": "^29.0.1", | ||
"@jest/types": "^29.0.1", | ||
"@types/babel__traverse": "^7.0.6", | ||
@@ -34,12 +34,12 @@ "@types/prettier": "^2.1.5", | ||
"chalk": "^4.0.0", | ||
"expect": "^29.0.0", | ||
"expect": "^29.0.1", | ||
"graceful-fs": "^4.2.9", | ||
"jest-diff": "^29.0.0", | ||
"jest-diff": "^29.0.1", | ||
"jest-get-type": "^29.0.0", | ||
"jest-haste-map": "^29.0.0", | ||
"jest-matcher-utils": "^29.0.0", | ||
"jest-message-util": "^29.0.0", | ||
"jest-util": "^29.0.0", | ||
"jest-haste-map": "^29.0.1", | ||
"jest-matcher-utils": "^29.0.1", | ||
"jest-message-util": "^29.0.1", | ||
"jest-util": "^29.0.1", | ||
"natural-compare": "^1.4.0", | ||
"pretty-format": "^29.0.0", | ||
"pretty-format": "^29.0.1", | ||
"semver": "^7.3.5" | ||
@@ -50,3 +50,3 @@ }, | ||
"@babel/preset-react": "^7.12.1", | ||
"@jest/test-utils": "^29.0.0", | ||
"@jest/test-utils": "^29.0.1", | ||
"@tsd/typescript": "~4.7.4", | ||
@@ -59,3 +59,3 @@ "@types/graceful-fs": "^4.1.3", | ||
"prettier": "^2.1.1", | ||
"tsd-lite": "^0.5.6" | ||
"tsd-lite": "^0.6.0" | ||
}, | ||
@@ -68,3 +68,3 @@ "engines": { | ||
}, | ||
"gitHead": "75006e46c76f6fda14bbc0548f86edb2ba087cd2" | ||
"gitHead": "b959a3d3bdf324ed1c7358f76ab238a8b0b0cf93" | ||
} |
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
82403
14
2384
Updated@jest/expect-utils@^29.0.1
Updated@jest/transform@^29.0.1
Updated@jest/types@^29.0.1
Updatedexpect@^29.0.1
Updatedjest-diff@^29.0.1
Updatedjest-haste-map@^29.0.1
Updatedjest-matcher-utils@^29.0.1
Updatedjest-message-util@^29.0.1
Updatedjest-util@^29.0.1
Updatedpretty-format@^29.0.1