@types/jest-image-snapshot 4.3.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
@@ -8,7 +8,7 @@ This package contains type definitions for jest-image-snapshot (https://github.c
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest-image-snapshot.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 26 Feb 2021 15:59:06 GMT
11
+ * Last updated: Fri, 24 Jun 2022 07:31:36 GMT
12
12
  * Dependencies: [@types/pixelmatch](https://npmjs.com/package/@types/pixelmatch), [@types/ssim.js](https://npmjs.com/package/@types/ssim.js), [@types/jest](https://npmjs.com/package/@types/jest)
13
13
  * Global values: none
14
14
 
@@ -1,12 +1,13 @@
1
- // Type definitions for jest-image-snapshot 4.3
1
+ // Type definitions for jest-image-snapshot 5.1
2
2
  // Project: https://github.com/americanexpress/jest-image-snapshot#readme
3
3
  // Definitions by: Janeene Beeforth <https://github.com/dawnmist>
4
4
  // erbridge <https://github.com/erbridge>
5
5
  // Piotr Błażejewicz <https://github.com/peterblazejewicz>
6
6
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
- // TypeScript Version: 3.8
7
+ // Minimum TypeScript Version: 4.3
8
8
 
9
9
  /// <reference types="jest" />
10
+
10
11
  import { PixelmatchOptions } from 'pixelmatch';
11
12
  import { Options as SSIMOptions } from 'ssim.js';
12
13
 
@@ -15,26 +16,36 @@ export interface MatchImageSnapshotOptions {
15
16
  * If set to true, the build will not fail when the screenshots to compare have different sizes.
16
17
  * @default false
17
18
  */
18
- allowSizeMismatch?: boolean;
19
+ allowSizeMismatch?: boolean | undefined;
19
20
  /**
20
21
  * Custom config passed to 'pixelmatch' or 'ssim'
21
22
  */
22
- customDiffConfig?: PixelmatchOptions | Partial<SSIMOptions>;
23
+ customDiffConfig?: PixelmatchOptions | Partial<SSIMOptions> | undefined;
23
24
  /**
24
25
  * The method by which images are compared.
25
26
  * `pixelmatch` does a pixel by pixel comparison, whereas `ssim` does a structural similarity comparison.
26
27
  * @default 'pixelmatch'
27
28
  */
28
- comparisonMethod?: 'pixelmatch' | 'ssim';
29
+ comparisonMethod?: 'pixelmatch' | 'ssim' | undefined;
29
30
  /**
30
31
  * Custom snapshots directory.
31
32
  * Absolute path of a directory to keep the snapshot in.
32
33
  */
33
- customSnapshotsDir?: string;
34
+ customSnapshotsDir?: string | undefined;
34
35
  /**
35
36
  * A custom absolute path of a directory to keep this diff in
36
37
  */
37
- customDiffDir?: string;
38
+ customDiffDir?: string | undefined;
39
+ /**
40
+ * Store the received images separately from the composed diff images on failure.
41
+ * This can be useful when updating baseline images from CI.
42
+ * @default false
43
+ */
44
+ storeReceivedOnFailure?: boolean | undefined;
45
+ /**
46
+ * A custom absolute path of a directory to keep this received image in.
47
+ */
48
+ customReceivedDir?: string | undefined;
38
49
  /**
39
50
  * A custom name to give this snapshot. If not provided, one is computed automatically. When a function is provided
40
51
  * it is called with an object containing testPath, currentTestName, counter and defaultIdentifier as its first
@@ -47,58 +58,59 @@ export interface MatchImageSnapshotOptions {
47
58
  counter: number;
48
59
  defaultIdentifier: string;
49
60
  }) => string)
50
- | string;
61
+ | string
62
+ | undefined;
51
63
  /**
52
64
  * Changes diff image layout direction.
53
65
  * @default 'horizontal'
54
66
  */
55
- diffDirection?: 'horizontal' | 'vertical';
67
+ diffDirection?: 'horizontal' | 'vertical' | undefined;
56
68
  /**
57
69
  * Will output base64 string of a diff image to console in case of failed tests (in addition to creating a diff image).
58
70
  * This string can be copy-pasted to a browser address string to preview the diff for a failed test.
59
71
  * @default false
60
72
  */
61
- dumpDiffToConsole?: boolean;
73
+ dumpDiffToConsole?: boolean | undefined;
62
74
  /**
63
75
  * Will output the image to the terminal using iTerm's Inline Images Protocol.
64
76
  * If the term is not compatible, it does the same thing as `dumpDiffToConsole`.
65
77
  * @default false
66
78
  */
67
- dumpInlineDiffToConsole?: boolean;
79
+ dumpInlineDiffToConsole?: boolean | undefined;
68
80
  /**
69
81
  * Removes coloring from the console output, useful if storing the results to a file.
70
82
  * @default false.
71
83
  */
72
- noColors?: boolean;
84
+ noColors?: boolean | undefined;
73
85
  /**
74
86
  * Sets the threshold that would trigger a test failure based on the failureThresholdType selected. This is different
75
87
  * to the customDiffConfig.threshold above - the customDiffConfig.threshold is the per pixel failure threshold, whereas
76
88
  * this is the failure threshold for the entire comparison.
77
89
  * @default 0.
78
90
  */
79
- failureThreshold?: number;
91
+ failureThreshold?: number | undefined;
80
92
  /**
81
93
  * Sets the type of threshold that would trigger a failure.
82
94
  * @default 'pixel'.
83
95
  */
84
- failureThresholdType?: 'pixel' | 'percent';
96
+ failureThresholdType?: 'pixel' | 'percent' | undefined;
85
97
  /**
86
98
  * Updates a snapshot even if it passed the threshold against the existing one.
87
99
  * @default false.
88
100
  */
89
- updatePassedSnapshot?: boolean;
101
+ updatePassedSnapshot?: boolean | undefined;
90
102
  /**
91
103
  * Applies Gaussian Blur on compared images, accepts radius in pixels as value. Useful when you have noise after
92
104
  * scaling images per different resolutions on your target website, usually setting its value to 1-2 should be
93
105
  * enough to solve that problem.
94
106
  * @default 0.
95
107
  */
96
- blur?: number;
108
+ blur?: number | undefined;
97
109
  /**
98
110
  * Runs the diff in process without spawning a child process.
99
111
  * @default false.
100
112
  */
101
- runInProcess?: boolean;
113
+ runInProcess?: boolean | undefined;
102
114
  }
103
115
 
104
116
  /**
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@types/jest-image-snapshot",
3
- "version": "4.3.0",
3
+ "version": "5.1.0",
4
4
  "description": "TypeScript definitions for jest-image-snapshot",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest-image-snapshot",
5
6
  "license": "MIT",
6
7
  "contributors": [
7
8
  {
@@ -33,6 +34,6 @@
33
34
  "@types/pixelmatch": "*",
34
35
  "ssim.js": "^3.1.1"
35
36
  },
36
- "typesPublisherContentHash": "d027b95b142fe32bf7dde079cdecb9b17580aac643c8d260c7b7cb69ab6a5ecc",
37
- "typeScriptVersion": "3.8"
37
+ "typesPublisherContentHash": "d482cc53ade896f7d9d914a0f169c33fae0bfd438a70796b67f2f0e468b3086d",
38
+ "typeScriptVersion": "4.3"
38
39
  }