Skip to content

Commit b27bd00

Browse files
andrewdacenkofacebook-github-bot
authored andcommitted
add jest-diff to dependencies (#47990)
Summary: Pull Request resolved: #47990 Changelog: [General][Added] - add `jest-diff v29.7.0` to devDependencies Reviewed By: NickGerleman Differential Revision: D66541001 fbshipit-source-id: 01c59a936b66f85ce034b59c7928df3c3f8c2a01
1 parent 2aa7997 commit b27bd00

3 files changed

Lines changed: 45 additions & 1 deletion

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
3+
*
4+
* @flow strict
5+
* @format
6+
* @oncall react_native
7+
*/
8+
9+
declare module 'jest-diff' {
10+
import type {CompareKeys} from 'pretty-format';
11+
12+
declare export type DiffOptionsColor = (arg: string) => string; // subset of Chalk type
13+
14+
declare export type DiffOptions = {
15+
aAnnotation?: string,
16+
aColor?: DiffOptionsColor,
17+
aIndicator?: string,
18+
bAnnotation?: string,
19+
bColor?: DiffOptionsColor,
20+
bIndicator?: string,
21+
changeColor?: DiffOptionsColor,
22+
changeLineTrailingSpaceColor?: DiffOptionsColor,
23+
commonColor?: DiffOptionsColor,
24+
commonIndicator?: string,
25+
commonLineTrailingSpaceColor?: DiffOptionsColor,
26+
contextLines?: number,
27+
emptyFirstOrLastLinePlaceholder?: string,
28+
expand?: boolean,
29+
includeChangeCounts?: boolean,
30+
omitAnnotationLines?: boolean,
31+
patchColor?: DiffOptionsColor,
32+
compareKeys?: CompareKeys,
33+
};
34+
35+
declare export function diff(
36+
a: mixed,
37+
b: mixed,
38+
options?: DiffOptions,
39+
): string | null;
40+
}

flow-typed/npm/pretty-format_v29.x.x.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ declare type Colors = {
1919
tag: {close: string, open: string},
2020
value: {close: string, open: string},
2121
};
22-
declare type CompareKeys = ((a: string, b: string) => number) | null | void;
2322

2423
declare type PrettyFormatPlugin =
2524
| {
@@ -38,6 +37,10 @@ declare type PrettyFormatPlugin =
3837
};
3938

4039
declare module 'pretty-format' {
40+
declare export type CompareKeys =
41+
| ((a: string, b: string) => number)
42+
| null
43+
| void;
4144
declare export function format(
4245
value: mixed,
4346
options?: ?{

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"hermes-transform": "0.25.1",
8484
"inquirer": "^7.1.0",
8585
"jest": "^29.6.3",
86+
"jest-diff": "^29.7.0",
8687
"jest-junit": "^10.0.0",
8788
"jscodeshift": "^0.14.0",
8889
"metro-babel-register": "^0.81.0",

0 commit comments

Comments
 (0)