try-to-tape

2019-03-15 admin

try-to-tape是什么

什么是try-to-tape,wrap tape async functions and show error on reject

try-to-tape使用教程帮助文档

Try to Tape NPM version Dependency Status Build Status Coverage Status

Wrap tape async functions and show error on reject.

Install

npm i try-to-tape

Example

const tryToTape = require('try-to-tape');
const tape = tryToTape(require('tape'));

test('lib: arguments', async (t) => {
    throw Error('hello');
    // will call t.fail with an error
    // will call t.end

    t.end();
});

Related

License

MIT

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-57767.html

文章标题:try-to-tape

回到顶部