Skip to content

Commit

Permalink
stream example
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Mar 4, 2014
1 parent 26c05e3 commit 47848f2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
10 changes: 10 additions & 0 deletions example/stream/object.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var test = require('../../');
var path = require('path');
var fs = require('fs');
test.createStream({ objectMode: true }).on('data', function (row) {
console.log(JSON.stringify(row))
});

process.argv.slice(2).forEach(function (file) {
require(path.resolve(file));
});
8 changes: 8 additions & 0 deletions example/stream/tap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var test = require('../../');
var path = require('path');
var fs = require('fs');
test.createStream().pipe(process.stdout);

process.argv.slice(2).forEach(function (file) {
require(path.resolve(file));
});
5 changes: 5 additions & 0 deletions example/stream/test/x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var test = require('../../../');
test(function (t) {
t.plan(1);
t.equal('beep', 'boop');
});
11 changes: 11 additions & 0 deletions example/stream/test/y.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var test = require('../../../');
test(function (t) {
t.plan(2);
t.equal(1+1, 2);
t.ok(true);
});

test('wheee', function (t) {
t.ok(true);
t.end();
});

0 comments on commit 47848f2

Please sign in to comment.