Skip to content

Commit 2a84cde

Browse files
🤖 Merge PR DefinitelyTyped#51439 update(jest-image-snapshot): v4.3 update by @peterblazejewicz
- `dumpInlineDiffToConsole` option - align with 4.3 version deps - drop v.2 to avoid maintenance burden - minor code format https://github.com/americanexpress/jest-image-snapshot#%EF%B8%8F-api Thanks!
1 parent f6ddda2 commit 2a84cde

File tree

7 files changed

+19
-209
lines changed

7 files changed

+19
-209
lines changed

‎types/jest-image-snapshot/index.d.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Type definitions for jest-image-snapshot 4.1
1+
// Type definitions for jest-image-snapshot 4.3
22
// Project: https://github.com/americanexpress/jest-image-snapshot#readme
33
// Definitions by: Janeene Beeforth <https://github.com/dawnmist>
44
// erbridge <https://github.com/erbridge>
@@ -59,6 +59,12 @@ export interface MatchImageSnapshotOptions {
5959
* @default false
6060
*/
6161
dumpDiffToConsole?: boolean;
62+
/**
63+
* Will output the image to the terminal using iTerm's Inline Images Protocol.
64+
* If the term is not compatible, it does the same thing as `dumpDiffToConsole`.
65+
* @default false
66+
*/
67+
dumpInlineDiffToConsole?: boolean;
6268
/**
6369
* Removes coloring from the console output, useful if storing the results to a file.
6470
* @default false.
@@ -117,7 +123,10 @@ export function configureToMatchImageSnapshot(
117123
/**
118124
* Mutates original state with new state
119125
*/
120-
export function updateSnapshotState<TObject, TPartial>(originalSnapshotState: TObject, partialSnapshotState: TPartial): TObject & TPartial;
126+
export function updateSnapshotState<TObject, TPartial>(
127+
originalSnapshotState: TObject,
128+
partialSnapshotState: TPartial,
129+
): TObject & TPartial;
121130

122131
declare global {
123132
namespace jest {

‎types/jest-image-snapshot/jest-image-snapshot-tests.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
// Typescript Version: 2.3
2-
import { configureToMatchImageSnapshot, MatchImageSnapshotOptions, toMatchImageSnapshot, updateSnapshotState } from 'jest-image-snapshot';
1+
import {
2+
configureToMatchImageSnapshot,
3+
MatchImageSnapshotOptions,
4+
toMatchImageSnapshot,
5+
updateSnapshotState,
6+
} from 'jest-image-snapshot';
37

48
it('should be able to use toMatchImageSnapshot in a test', () => {
59
expect.extend({ toMatchImageSnapshot });
@@ -35,6 +39,7 @@ it('Should be able to use configuration directly in toMatchImageSnapshot', () =>
3539
},
3640
customDiffDir: './diffs',
3741
diffDirection: 'vertical',
42+
dumpInlineDiffToConsole: true,
3843
updatePassedSnapshot: true,
3944
failureThreshold: 10,
4045
failureThresholdType: 'percent',
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
33
"dependencies": {
4-
"ssim.js": "^3.1.0"
4+
"ssim.js": "^3.1.1"
55
}
66
}

‎types/jest-image-snapshot/v2/index.d.ts‎

Lines changed: 0 additions & 117 deletions
This file was deleted.

‎types/jest-image-snapshot/v2/jest-image-snapshot-tests.ts‎

Lines changed: 0 additions & 58 deletions
This file was deleted.

‎types/jest-image-snapshot/v2/tsconfig.json‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎types/jest-image-snapshot/v2/tslint.json‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)