https://github.com/af/tap-extras
Wraps the tap-parser npm module to also parse extra lines (stack traces, etc)
https://github.com/af/tap-extras
Last synced: 22 days ago
JSON representation
Wraps the tap-parser npm module to also parse extra lines (stack traces, etc)
- Host: GitHub
- URL: https://github.com/af/tap-extras
- Owner: af
- License: mit
- Created: 2014-03-03T00:39:22.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-03T00:40:20.000Z (over 12 years ago)
- Last Synced: 2025-12-02T05:37:00.966Z (7 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tap-extras
==========
A small wrapper module for [tap-parser](https://github.com/substack/tap-parser)
that adds extra lines to the parsed TAP output.
Usage
-----
Use this module just like you would use `tap-parser`:
```
var parser = require('tap-extras');
var p = parser(function (results) {
console.dir(results);
});
process.stdin.pipe(p);
```
This might give you output like the following. The only difference
from `tap-parser`'s outputs is that each assertion
will have an `"extra"` attribute. This will point to any extra lines
emitted by your tests (TAP comments, stack traces, or any other
diagnostic information):
```
{ ok: true,
asserts:
[ { ok: true, number: 1, name: 'should be equal', extra: ''},
{ ok: true, number: 2, name: 'should be equivalent' , extra: ''},
{ ok: false, number: 3, name: 'should be equal' , extra: ' ---\n $extra_test_context\n ...'},
{ ok: true, number: 4, name: '(unnamed assert)', extra: ''} ],
pass:
[ { ok: true, number: 1, name: 'should be equal', extra: '' },
{ ok: true, number: 2, name: 'should be equivalent', extra: '' },
{ ok: true, number: 4, name: '(unnamed assert)', extra: '' } ],
fail: [
{ ok: false, number: 3, name: 'should be equal' , extra: ' ---\n $extra_test_context\n ...'},
],
todo: [],
errors: [],
plan: { start: 1, end: 4 } }
```
Background
----------
This feature was [suggested](https://github.com/substack/tap-parser/issues/7)
for integration into the tap-parser module. Since it wasn't accepted, it lives
on in this wrapper module instead.