File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff 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
2423declare type PrettyFormatPlugin =
2524 | {
@@ -38,6 +37,10 @@ declare type PrettyFormatPlugin =
3837 } ;
3938
4039declare 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 ?: ?{
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments