From c8e11e1f2c9b537c7fbf5bdf1cb6defaa83f41e3 Mon Sep 17 00:00:00 2001 From: James Halliday Date: Mon, 3 Dec 2012 21:33:13 -0800 Subject: [PATCH] update tests to thread through exit: false --- index.js | 4 ++-- test/fail.js | 2 +- test/harness.js | 2 +- test/too_many.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index d4565ba9..a36e7331 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ var canExit = typeof process !== 'undefined' && process && typeof process.exit === 'function' ; -function createHarness () { +function createHarness (conf_) { var pending = []; var running = false; @@ -22,7 +22,7 @@ function createHarness () { var test = function (name, conf, cb) { var t = new Test(name, conf, cb); - if (!conf || typeof conf !== 'object') conf = {}; + if (!conf || typeof conf !== 'object') conf = conf_ || {}; if (conf.exit !== false && canEmitExit) { process.on('exit', function (code) { diff --git a/test/fail.js b/test/fail.js index dbc1e46a..878394f0 100644 --- a/test/fail.js +++ b/test/fail.js @@ -5,7 +5,7 @@ var tap = require('tap'); tap.test('array test', function (tt) { tt.plan(1); - var test = tape.createHarness(); + var test = tape.createHarness({ exit : false }); var tc = tap.createConsumer(); var rows = []; diff --git a/test/harness.js b/test/harness.js index c2b8dc7c..4f47f362 100644 --- a/test/harness.js +++ b/test/harness.js @@ -1,5 +1,5 @@ var test = require('../'); -var harness = test.createHarness(); +var harness = test.createHarness({ exit : false }); // minimal write stream mockery var collector = { diff --git a/test/too_many.js b/test/too_many.js index d92faa9b..d949a03f 100644 --- a/test/too_many.js +++ b/test/too_many.js @@ -5,7 +5,7 @@ var tap = require('tap'); tap.test('array test', function (tt) { tt.plan(1); - var test = tape.createHarness(); + var test = tape.createHarness({ exit : false }); var tc = tap.createConsumer(); var rows = [];