Skip to content

Commit

Permalink
fix default harness going off unexpectedly
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 2, 2013
1 parent 6417cdc commit b1c1d6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions index.js
Expand Up @@ -15,9 +15,14 @@ var nextTick = typeof setImmediate !== 'undefined'
;

exports = module.exports = (function () {
var harness = createHarness();
harness.createStream().pipe(createDefaultStream());
return harness;
var harness;
return function () {
if (!harness) {
harness = createHarness();
harness.createStream().pipe(createDefaultStream());
}
return harness.apply(this, arguments);
};
})();

exports.createHarness = createHarness;
Expand Down
2 changes: 1 addition & 1 deletion test/array.js
Expand Up @@ -31,7 +31,7 @@ tap.test('array test', function (tt) {
]);
});

test.stream.pipe(tc);
test.createStream().pipe(tc);

test('array', function (t) {
t.plan(5);
Expand Down

0 comments on commit b1c1d6a

Please sign in to comment.