Jest Matchers for fp-ts
This library provides Jest matchers to nicely test code based on
fp-ts
. Currently it provides matchers for Option
and Either
.
Installation
First add the dependency to your project:
yarn add --dev fp-ts-jest-matchers
Then make sure this package is loaded by Jest. If you have a file
setupTests.ts
, you can include it there:
If not, you may need to add this to your Jest config:
"jest":
Usage
After installation, you can now write assertions like these in your test:
it'can test fp-ts options',