jest-matcher-utils
- Version 30.2.0
- Published
- 36.1 kB
- 4 dependencies
- MIT license
Install
npm i jest-matcher-utilsyarn add jest-matcher-utilspnpm add jest-matcher-utilsOverview
A set of utility functions for expect and related packages
Index
Variables
Functions
- diff()
- ensureActualIsNumber()
- ensureExpectedIsNonNegativeInteger()
- ensureExpectedIsNumber()
- ensureNoExpected()
- ensureNumbers()
- getLabelPrinter()
- highlightTrailingWhitespace()
- matcherErrorMessage()
- matcherHint()
- pluralize()
- printDiffOrStringify()
- printExpected()
- printReceived()
- printWithType()
- replaceMatchedToAsymmetricMatcher()
- stringify()
Type Aliases
Variables
variable BOLD_WEIGHT
const BOLD_WEIGHT: Chalk;variable DIM_COLOR
const DIM_COLOR: Chalk;variable EXPECTED_COLOR
const EXPECTED_COLOR: Chalk;variable INVERTED_COLOR
const INVERTED_COLOR: Chalk;variable RECEIVED_COLOR
const RECEIVED_COLOR: Chalk;variable SERIALIZABLE_PROPERTIES
const SERIALIZABLE_PROPERTIES: Symbol;variable SUGGEST_TO_CONTAIN_EQUAL
const SUGGEST_TO_CONTAIN_EQUAL: string;Functions
function diff
diff: (a: unknown, b: unknown, options?: DiffOptions_2) => string | null;function ensureActualIsNumber
ensureActualIsNumber: (    actual: unknown,    matcherName: string,    options?: MatcherHintOptions) => void;- Ensures that - actualis of type- number | bigint
function ensureExpectedIsNonNegativeInteger
ensureExpectedIsNonNegativeInteger: (    expected: unknown,    matcherName: string,    options?: MatcherHintOptions) => void;function ensureExpectedIsNumber
ensureExpectedIsNumber: (    expected: unknown,    matcherName: string,    options?: MatcherHintOptions) => void;- Ensures that - expectedis of type- number | bigint
function ensureNoExpected
ensureNoExpected: (    expected: unknown,    matcherName: string,    options?: MatcherHintOptions) => void;function ensureNumbers
ensureNumbers: (    actual: unknown,    expected: unknown,    matcherName: string,    options?: MatcherHintOptions) => void;- Ensures that - actual&- expectedare of type- number | bigint
function getLabelPrinter
getLabelPrinter: (...strings: Array<string>) => PrintLabel;function highlightTrailingWhitespace
highlightTrailingWhitespace: (text: string) => string;function matcherErrorMessage
matcherErrorMessage: (    hint: string,    generic: string,    specific?: string) => string;function matcherHint
matcherHint: (    matcherName: string,    received?: string,    expected?: string,    options?: MatcherHintOptions) => string;function pluralize
pluralize: (word: string, count: number) => string;function printDiffOrStringify
printDiffOrStringify: (    expected: unknown,    received: unknown,    expectedLabel: string,    receivedLabel: string,    expand: boolean) => string;function printExpected
printExpected: (value: unknown) => string;function printReceived
printReceived: (object: unknown) => string;function printWithType
printWithType: <T>(    name: string,    value: T,    print: (value: T) => string) => string;function replaceMatchedToAsymmetricMatcher
replaceMatchedToAsymmetricMatcher: (    replacedExpected: unknown,    replacedReceived: unknown,    expectedCycles: Array<unknown>,    receivedCycles: Array<unknown>) => { replacedExpected: unknown; replacedReceived: unknown };function stringify
stringify: (object: unknown, maxDepth?: number, maxWidth?: number) => string;Type Aliases
type DiffOptions
type DiffOptions = DiffOptions_2;type MatcherHintOptions
type MatcherHintOptions = {    comment?: string;    expectedColor?: MatcherHintColor;    isDirectExpectCall?: boolean;    isNot?: boolean;    promise?: string;    receivedColor?: MatcherHintColor;    secondArgument?: string;    secondArgumentColor?: MatcherHintColor;};Package Files (1)
Dependencies (4)
Dev Dependencies (2)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/jest-matcher-utils.
- Markdown[](https://www.jsdocs.io/package/jest-matcher-utils)
- HTML<a href="https://www.jsdocs.io/package/jest-matcher-utils"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
 Package analyzed in 3392 ms.
- Missing or incorrect documentation? Open an issue for this package.
