Pacote
    Preparing search index...

    Function toEqualRight

    • Asserts that the right side of an Either equals an expected value or asymmetric matcher.

      Type Parameters

      • R

        Type of the expected right value.

      Parameters

      • actual: unknown
      • expected: AsymmetricMatcher | R

        Value or asymmetric matcher that should equal the right side.

      Returns MatcherResult

      import { right } from 'fp-ts/lib/Either'

      test('passes when right of Either equals a value', () => {
      const actual = right({ test: 'ok' })
      expect(actual).toEqualRight({ test: 'ok' })
      })

      test('passes when right of Either does not equal a value', () => {
      const actual = right({ test: 'unexpected' })
      expect(actual).not.toEqualRight({ test: 'ok' })
      })