UNPKG

@yoroi/common

Version:

The Common package of Yoroi SDK

38 lines (37 loc) 980 B
"use strict"; var _monads = require("./monads"); describe('Either helper functions', () => { describe('isLeft', () => { it('returns true if Either is Left', () => { const left = { tag: 'left', error: new Error('Error') }; expect((0, _monads.isLeft)(left)).toBe(true); }); it('returns false if Either is Right', () => { const right = { tag: 'right', value: 'Success' }; expect((0, _monads.isLeft)(right)).toBe(false); }); }); describe('isRight', () => { it('returns true if Either is Right', () => { const right = { tag: 'right', value: 'Success' }; expect((0, _monads.isRight)(right)).toBe(true); }); it('returns false if Either is Left', () => { const left = { tag: 'left', error: new Error('Error') }; expect((0, _monads.isRight)(left)).toBe(false); }); }); }); //# sourceMappingURL=monads.test.js.map