Skip to content

Commit 47848f2

Browse files
author
James Halliday
committed
stream example
1 parent 26c05e3 commit 47848f2

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

example/stream/object.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var test = require('../../');
2+
var path = require('path');
3+
var fs = require('fs');
4+
test.createStream({ objectMode: true }).on('data', function (row) {
5+
console.log(JSON.stringify(row))
6+
});
7+
8+
process.argv.slice(2).forEach(function (file) {
9+
require(path.resolve(file));
10+
});

example/stream/tap.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var test = require('../../');
2+
var path = require('path');
3+
var fs = require('fs');
4+
test.createStream().pipe(process.stdout);
5+
6+
process.argv.slice(2).forEach(function (file) {
7+
require(path.resolve(file));
8+
});

example/stream/test/x.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var test = require('../../../');
2+
test(function (t) {
3+
t.plan(1);
4+
t.equal('beep', 'boop');
5+
});

example/stream/test/y.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var test = require('../../../');
2+
test(function (t) {
3+
t.plan(2);
4+
t.equal(1+1, 2);
5+
t.ok(true);
6+
});
7+
8+
test('wheee', function (t) {
9+
t.ok(true);
10+
t.end();
11+
});

0 commit comments

Comments
 (0)