assert-extends
power-assert module extends
Last updated a year ago by fengmk2 .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install assert-extends 
SYNC missed versions from official npm registry.

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

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |