Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MatcherUtils

Hierarchy

  • MatcherUtils

Indexable

[other: string]: any

Index

Properties

assertionCalls

assertionCalls: number

currentTestName

currentTestName: string

dontThrow

dontThrow: () => void

Type declaration

    • (): void
    • Returns void

expand

expand: boolean

expectedAssertionsNumber

expectedAssertionsNumber: number | null

isExpectingAssertions

isExpectingAssertions: boolean

isNot

isNot: boolean

promise

promise: string

suppressedErrors

suppressedErrors: any[]

testPath

testPath: string

utils

utils: { BOLD_WEIGHT: MatcherColorFn; DIM_COLOR: MatcherColorFn; EXPECTED_COLOR: MatcherColorFn; INVERTED_COLOR: MatcherColorFn; RECEIVED_COLOR: MatcherColorFn; SUGGEST_TO_CONTAIN_EQUAL: string; iterableEquality: EqualityTester; subsetEquality: EqualityTester; diff: any; ensureActualIsNumber: any; ensureExpectedIsNonNegativeInteger: any; ensureExpectedIsNumber: any; ensureNoExpected: any; ensureNumbers: any; getLabelPrinter: any; highlightTrailingWhitespace: any; matcherErrorMessage: any; matcherHint: any; pluralize: any; printDiffOrStringify: any; printExpected: any; printReceived: any; printWithType: any; stringify: any }

Type declaration

  • BOLD_WEIGHT: MatcherColorFn
  • DIM_COLOR: MatcherColorFn
  • EXPECTED_COLOR: MatcherColorFn
  • INVERTED_COLOR: MatcherColorFn
  • RECEIVED_COLOR: MatcherColorFn
  • SUGGEST_TO_CONTAIN_EQUAL: string
  • iterableEquality: EqualityTester
  • subsetEquality: EqualityTester
  • diff: function
    • diff(a: any, b: any, options?: undefined | { aAnnotation?: undefined | string; aColor?: DiffOptionsColor; aIndicator?: undefined | string; bAnnotation?: undefined | string; bColor?: DiffOptionsColor; bIndicator?: undefined | string; changeColor?: DiffOptionsColor; changeLineTrailingSpaceColor?: DiffOptionsColor; commonColor?: DiffOptionsColor; commonIndicator?: undefined | string; commonLineTrailingSpaceColor?: DiffOptionsColor; contextLines?: undefined | number; emptyFirstOrLastLinePlaceholder?: undefined | string; expand?: undefined | false | true; includeChangeCounts?: undefined | false | true; omitAnnotationLines?: undefined | false | true; patchColor?: DiffOptionsColor }): string | null
    • Parameters

      • a: any
      • b: any
      • Optional options: undefined | { aAnnotation?: undefined | string; aColor?: DiffOptionsColor; aIndicator?: undefined | string; bAnnotation?: undefined | string; bColor?: DiffOptionsColor; bIndicator?: undefined | string; changeColor?: DiffOptionsColor; changeLineTrailingSpaceColor?: DiffOptionsColor; commonColor?: DiffOptionsColor; commonIndicator?: undefined | string; commonLineTrailingSpaceColor?: DiffOptionsColor; contextLines?: undefined | number; emptyFirstOrLastLinePlaceholder?: undefined | string; expand?: undefined | false | true; includeChangeCounts?: undefined | false | true; omitAnnotationLines?: undefined | false | true; patchColor?: DiffOptionsColor }

      Returns string | null

  • ensureActualIsNumber: function
    • ensureActualIsNumber(actual: any, matcherName: string, options?: MatcherHintOptions): void
    • Parameters

      Returns void

  • ensureExpectedIsNonNegativeInteger: function
    • ensureExpectedIsNonNegativeInteger(expected: any, matcherName: string, options?: MatcherHintOptions): void
    • Parameters

      Returns void

  • ensureExpectedIsNumber: function
    • ensureExpectedIsNumber(actual: any, matcherName: string, options?: MatcherHintOptions): void
    • Parameters

      Returns void

  • ensureNoExpected: function
    • Parameters

      Returns void

  • ensureNumbers: function
    • ensureNumbers(actual: any, expected: any, matcherName: string, options?: MatcherHintOptions): void
    • Parameters

      Returns void

  • getLabelPrinter: function
    • getLabelPrinter(...strings: string[]): PrintLabel
    • Parameters

      • Rest ...strings: string[]

      Returns PrintLabel

  • highlightTrailingWhitespace: function
    • highlightTrailingWhitespace(text: string): string
    • Parameters

      • text: string

      Returns string

  • matcherErrorMessage: function
    • matcherErrorMessage(hint: string, generic: string, specific: string): string
    • Parameters

      • hint: string
      • generic: string
      • specific: string

      Returns string

  • matcherHint: function
    • matcherHint(matcherName: string, received?: undefined | string, expected?: undefined | string, options?: MatcherHintOptions): string
    • Parameters

      • matcherName: string
      • Optional received: undefined | string
      • Optional expected: undefined | string
      • Optional options: MatcherHintOptions

      Returns string

  • pluralize: function
    • pluralize(word: string, count: number): string
    • Parameters

      • word: string
      • count: number

      Returns string

  • printDiffOrStringify: function
    • printDiffOrStringify(expected: any, received: any, expectedLabel: string, receivedLabel: string, expand: boolean): string
    • Parameters

      • expected: any
      • received: any
      • expectedLabel: string
      • receivedLabel: string
      • expand: boolean

      Returns string

  • printExpected: function
    • printExpected(value: any): string
    • Parameters

      • value: any

      Returns string

  • printReceived: function
    • printReceived(object: any): string
    • Parameters

      • object: any

      Returns string

  • printWithType: function
    • printWithType(name: string, value: any, print: (value: any) => string): string
    • Parameters

      • name: string
      • value: any
      • print: (value: any) => string
          • (value: any): string
          • Parameters

            • value: any

            Returns string

      Returns string

  • stringify: function
    • stringify(object: {}, maxDepth?: undefined | number): string
    • Parameters

      • object: {}
      • Optional maxDepth: undefined | number

      Returns string

Methods

equals

  • equals(a: any, b: any, customTesters?: EqualityTester[], strictCheck?: undefined | false | true): boolean
  • This is a deep-equality function that will return true if two objects have the same values (recursively).

    Parameters

    • a: any
    • b: any
    • Optional customTesters: EqualityTester[]
    • Optional strictCheck: undefined | false | true

    Returns boolean