chai-purify
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Chai Plugin for Purify

Chai assert helpers for Purify-TS ADTs

Install

$ npm install --save-dev chai-purify

Helpers

Maybe

    expect(Nothing).to.be.Maybe;
    expect(Nothing).to.be.Nothing;
    expect(Nothing).to.not.be.Just();

    expect(Just(5)).to.be.Maybe;
    expect(Just(5)).to.be.Just();
    expect(Just(5)).to.be.Just(5);
    expect(Just(5)).to.not.be.Just(10);
    expect(Just(5)).to.not.be.Nothing;
    expect(5).to.not.be.Just(5);

Either

    expect(Left('foo')).to.be.Either;
    expect(Left('foo')).to.be.Left();
    expect(Left('foo')).to.be.Left('foo');
    expect('foo').to.not.be.Left('foo');
    expect(Left('foo')).to.not.be.Right();


    expect(Right(5)).to.be.Either;
    expect(Right(5)).to.be.Right();
    expect(Right(5)).to.be.Right(5);
    expect(5).to.not.be.Right(5);
    expect(Right(5)).to.not.be.Left();

Readme

Keywords

Package Sidebar

Install

npm i chai-purify

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

8.95 kB

Total Files

12

Last publish

Collaborators

  • chenguo