jest-matcher-utils

  • Version 27.2.5
  • Published
  • 27.8 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: any;

    variable DIM_COLOR

    const DIM_COLOR: any;

      variable EXPECTED_COLOR

      const EXPECTED_COLOR: any;

        variable INVERTED_COLOR

        const INVERTED_COLOR: any;

          variable RECEIVED_COLOR

          const RECEIVED_COLOR: any;

            variable SUGGEST_TO_CONTAIN_EQUAL

            const SUGGEST_TO_CONTAIN_EQUAL: string;

              Functions

              function diff

              diff: (
              a: unknown,
              b: unknown,
              options?: ImportDiffOptions | undefined
              ) => string | null;

                function ensureActualIsNumber

                ensureActualIsNumber: (
                actual: unknown,
                matcherName: string,
                options?: MatcherHintOptions | undefined
                ) => void;
                • Ensures that actual is of type number | bigint

                function ensureExpectedIsNonNegativeInteger

                ensureExpectedIsNonNegativeInteger: (
                expected: unknown,
                matcherName: string,
                options?: MatcherHintOptions | undefined
                ) => void;

                  function ensureExpectedIsNumber

                  ensureExpectedIsNumber: (
                  expected: unknown,
                  matcherName: string,
                  options?: MatcherHintOptions | undefined
                  ) => void;
                  • Ensures that expected is of type number | bigint

                  function ensureNoExpected

                  ensureNoExpected: (
                  expected: unknown,
                  matcherName: string,
                  options?: MatcherHintOptions | undefined
                  ) => void;

                    function ensureNumbers

                    ensureNumbers: (
                    actual: unknown,
                    expected: unknown,
                    matcherName: string,
                    options?: MatcherHintOptions | undefined
                    ) => 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 | undefined
                        ) => 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: (
                                    name: string,
                                    value: unknown,
                                    print: (value: unknown) => string
                                    ) => string;

                                      function stringify

                                      stringify: (object: unknown, maxDepth?: number) => string;

                                        Type Aliases

                                        type DiffOptions

                                        type DiffOptions = ImportDiffOptions;

                                          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>