UNPKG

875 BJavaScriptView Raw
1var tap = require('tap');
2var path = require('path');
3var spawn = require('child_process').spawn;
4var concat = require('concat-stream');
5
6tap.test('default messages', function (t) {
7 t.plan(1);
8
9 var ps = spawn(process.execPath, [path.join(__dirname, 'messages', 'defaults.js')]);
10
11 ps.stdout.pipe(concat(function (rows) {
12
13 t.same(rows.toString('utf8'), [
14 'TAP version 13',
15 '# default messages',
16 'ok 1 should be truthy',
17 'ok 2 should be falsy',
18 'ok 3 should be equal',
19 'ok 4 should not be equal',
20 'ok 5 should be equivalent',
21 'ok 6 should be equivalent',
22 'ok 7 should be equivalent',
23 '',
24 '1..7',
25 '# tests 7',
26 '# pass 7',
27 '',
28 '# ok'
29 ].join('\n') + '\n\n');
30 }));
31});