expect-to-promises

1.0.0 • Public • Published

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);

Package Sidebar

Install

npm i expect-to-promises

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • kimjoar