expect-to-be-a-promise

A chai matcher to assert the return value of a function is a thenable.

Usage no npm install needed!

<script type="module">
  import expectToBeAPromise from 'https://cdn.skypack.dev/expect-to-be-a-promise';
</script>

README

expect-to-be-a-promise

A chai matcher to assert the return value of a function is a thenable.

Usage

var chai = require('chai');
var expectToBeAPromise = require('expect-to-be-a-promise');

chai.use(expectToBeAPromise);

function doThing() {
  return new Promise(function(resolve, reject) {
    resolve('some value');
  });
}

it('is a promise', function() {
  expect(doThing()).to.be.a.promise;
});