assert-extends

power-assert module extends
ad

项目文档

assert-extends

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

power-assert module extends.

  • assert.asyncThrows(block[, error][, message])
  • Add mocha --require intelli-espower-loader to your test scripts.
  • 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);
});

MIT

vps-ad

下载趋势

项目成员