0.4.1 • Published 6 months ago

jest-fp-ts-matchers v0.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

jest-fp-ts-matchers

Collection of monad matchers to ease testing with Jest

Installation

npm install -D jest-fp-ts-matchers

Quick start

import { expectLeftEither } from 'jest-fp-ts-matchers';

test('returns left Either when parsing fails', () => {
  pipe(
    Parser.parse({ id: '' }),
    expectLeftEither((err) => {
      expect(err).toBeInstanceOf(Error);
      expect(err.message).toMatch(/001/);
    })
  );
});

Exported methods

  • expectLeftEither
  • expectRightEither
  • expectLeftΙΟEither
  • expectRightΙΟEither
  • expectLeftTaskEither
  • expectRightTaskEither
  • expectLeftReaderTaskEither
  • expectRightReaderTaskEither
  • expectSomeOption
  • expectNoneOption

Requirements

  • Node.js v.16+

License

MIT

0.4.1

6 months ago

0.4.0

8 months ago

0.3.0

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.4

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago