expect-to-promises
v1.0.0
Published
expect-to assertions for promises
Downloads
4
Maintainers
Readme
expect-to-promises
Promise assertions for expect-to.
Installation
npm install --save-dev expect-to-promises
Assertions
eventually
const foo = Promise.resolve('foo'); expect(foo).to(eventually(equal('foo'))); expect(foo).to(eventually(not(equal('bar')))); const obj = Promise.resolve({ name: 'kim' }); expect(obj).to(eventually(deepEqual({ name: 'kim' })));
beFulfilled
const foo = Promise.resolve('foo'); expect(foo).to(beFulfilled);
beRejected
const err = Promise.reject(new Error('bar')); expect(err).to(beRejected);