UNPKG

1.07 kBJavaScriptView Raw
1'use strict';
2
3var tape = require('../');
4var tap = require('tap');
5var concat = require('concat-stream');
6
7var stripFullStack = require('./common').stripFullStack;
8
9tap.test('failures', function (tt) {
10 tt.plan(1);
11
12 var test = tape.createHarness();
13 test.createStream().pipe(concat(function (body) {
14 tt.same(stripFullStack(body.toString('utf8')), [
15 'TAP version 13',
16 '# error',
17 'not ok 1 Error: this is a message',
18 ' ---',
19 ' operator: error',
20 ' at: Test.<anonymous> ($TEST/error.js:$LINE:$COL)',
21 ' stack: |-',
22 ' Error: this is a message',
23 ' at Test.<anonymous> ($TEST/error.js:$LINE:$COL)',
24 ' [... stack stripped ...]',
25 ' ...',
26 '',
27 '1..1',
28 '# tests 1',
29 '# pass 0',
30 '# fail 1',
31 ''
32 ]);
33 }));
34
35 test('error', function (t) {
36 t.plan(1);
37 t.error(new Error('this is a message'));
38 });
39});