https://github.com/coderaiser/try-to-tape
wrap tape async functions and show error on reject
https://github.com/coderaiser/try-to-tape
catch javascript nodejs tape tdd test try
Last synced: 3 months ago
JSON representation
wrap tape async functions and show error on reject
- Host: GitHub
- URL: https://github.com/coderaiser/try-to-tape
- Owner: coderaiser
- License: mit
- Created: 2018-11-08T16:56:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-29T06:45:01.000Z (about 5 years ago)
- Last Synced: 2025-05-26T01:11:41.798Z (4 months ago)
- Topics: catch, javascript, nodejs, tape, tdd, test, try
- Language: JavaScript
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
- License: LICENSE
Awesome Lists containing this project
README
# Try to Tape [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
[NPMIMGURL]: https://img.shields.io/npm/v/try-to-tape.svg?style=flat&longCache=true
[BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/try-to-tape/master.svg?style=flat&longCache=true
[DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/try-to-tape.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/try-to-tape "npm"
[BuildStatusURL]: https://travis-ci.org/coderaiser/try-to-tape "Build Status"
[DependencyStatusURL]: https://david-dm.org/coderaiser/try-to-tape "Dependency Status"[CoverageURL]: https://coveralls.io/github/coderaiser/try-to-tape?branch=master
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/try-to-tape/badge.svg?branch=master&service=githubWrap `tape` `async` functions and show error on reject. Bundled with [supertape](https://github.com/coderaiser/supertape).
## Install
```
npm i try-to-tape
```## Example
```js
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
- [try-catch](https://github.com/coderaiser/try-catch "TryCatch") - functional try-catch wrapper.
- [try-to-catch](https://github.com/coderaiser/try-to-catch "TryToCatch") - functional try-catch wrapper for promises.## License
MIT