Skip to content

Commit

Permalink
add jest-diff to dependencies (#47990)
Browse files Browse the repository at this point in the history
Summary:

Changelog: 
[General][Added] - add `jest-diff v29.7.0` to devDependencies

Reviewed By: NickGerleman

Differential Revision: D66541001
  • Loading branch information
andrewdacenko authored and facebook-github-bot committed Nov 28, 2024
1 parent bc9e4db commit a21e1f4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
40 changes: 40 additions & 0 deletions flow-typed/npm/jest-diff_v29.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @flow strict
* @format
* @oncall react_native
*/

declare module 'jest-diff' {
import type {CompareKeys} from 'pretty-format';

declare export type DiffOptionsColor = (arg: string) => string; // subset of Chalk type

declare export type DiffOptions = {
aAnnotation?: string,
aColor?: DiffOptionsColor,
aIndicator?: string,
bAnnotation?: string,
bColor?: DiffOptionsColor,
bIndicator?: string,
changeColor?: DiffOptionsColor,
changeLineTrailingSpaceColor?: DiffOptionsColor,
commonColor?: DiffOptionsColor,
commonIndicator?: string,
commonLineTrailingSpaceColor?: DiffOptionsColor,
contextLines?: number,
emptyFirstOrLastLinePlaceholder?: string,
expand?: boolean,
includeChangeCounts?: boolean,
omitAnnotationLines?: boolean,
patchColor?: DiffOptionsColor,
compareKeys?: CompareKeys,
};

declare export function diff(
a: mixed,
b: mixed,
options?: DiffOptions,
): string | null;
}
5 changes: 4 additions & 1 deletion flow-typed/npm/pretty-format_v29.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ declare type Colors = {
tag: {close: string, open: string},
value: {close: string, open: string},
};
declare type CompareKeys = ((a: string, b: string) => number) | null | void;

declare type PrettyFormatPlugin =
| {
Expand All @@ -38,6 +37,10 @@ declare type PrettyFormatPlugin =
};

declare module 'pretty-format' {
declare export type CompareKeys =
| ((a: string, b: string) => number)
| null
| void;
declare export function format(
value: mixed,
options?: ?{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"hermes-transform": "0.25.1",
"inquirer": "^7.1.0",
"jest": "^29.6.3",
"jest-diff": "^29.7.0",
"jest-junit": "^10.0.0",
"jscodeshift": "^0.14.0",
"metro-babel-register": "^0.81.0",
Expand Down

0 comments on commit a21e1f4

Please sign in to comment.