Nice Paintings, Mondrian
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

assert-extends

1.0.1 • Public • Published

assert-extends

NPM version build status Test coverage David deps Known Vulnerabilities npm download

power-assert module extends.

  • assert.asyncThrows(block[, error][, message])

Usage

  • Add mocha --require intelli-espower-loader to your test scripts.

assert throws with async function

  • API: assert.asyncThrows(block[, error][, message]), return a promise
it('should throw error', () => {
  return assert.asyncThrows(function* () {
    yield fs.readFile(filepath);
  }, /not exists/);
});
 
it('should throw error', function* () {
  yield assert.asyncThrows(function* () {
    yield fs.readFile(filepath);
  }, /not exists/);
});
 
it('should throw error', done => {
  assert.asyncThrows(function* () {
    yield fs.readFile(filepath);
  }, /not exists/).then(done).catch(done);
});

License

MIT

install

npm i assert-extends

Downloadsweekly downloads

4

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar