jest-matcher-utils

  • Version 30.0.0-beta.3
  • Published
  • 32.6 kB
  • 4 dependencies
  • MIT license

Install

npm i jest-matcher-utils
yarn add jest-matcher-utils
pnpm add jest-matcher-utils

Overview

A set of utility functions for expect and related packages

Index

Variables

variable BOLD_WEIGHT

const BOLD_WEIGHT: chalk.Chalk;

    variable DIM_COLOR

    const DIM_COLOR: chalk.Chalk;

      variable EXPECTED_COLOR

      const EXPECTED_COLOR: chalk.Chalk;

        variable INVERTED_COLOR

        const INVERTED_COLOR: chalk.Chalk;

          variable RECEIVED_COLOR

          const RECEIVED_COLOR: chalk.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 actual is 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 expected is 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 & expected are 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 onejsDocs.io badgeto 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
                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](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>