Pacote
    Preparing search index...

    Function toEqualLeft

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

      Type Parameters

      • L

        Type of the expected left value.

      Parameters

      • actual: unknown
      • expected: AsymmetricMatcher | L

        Value or asymmetric matcher that should equal the left side.

      Returns MatcherResult

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

      test('passes when left of Either equals a value', () => {
      const actual = left(Error('message'))
      expect(actual).toEqualLeft(Error('message'))
      })

      test('passes when left of Either does not equal a value', () => {
      const actual = left(Error('unexpected'))
      expect(actual).not.toEqualLeft(Error('message'))
      })