From 157ffddb7158651d263e85b131e8a0b37cbb8c75 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sun, 11 Sep 2016 21:47:58 -0700 Subject: [PATCH] Allow env TAP_BUFFER=1 to be overridden --- lib/test.js | 6 +++--- test/only-non-tap-output.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/test.js b/lib/test.js index 0fdb54cfa..1ce274369 100644 --- a/lib/test.js +++ b/lib/test.js @@ -52,7 +52,7 @@ function Test (options) { this._lineBuf = '' this._buffer = '' - this._buffered = options.buffered || false + this._buffered = options.buffered this._deferred = null this._autoend = !!options.autoend this._name = options.name || '(unnamed test)' @@ -426,10 +426,10 @@ function getBufferedOption (self, extra) { return true } else if (extra.buffered === false) { return false + } else if (self._buffered !== undefined) { + return self._buffered } else if (process.env.TAP_BUFFER === '1') { return true - } else if (self._buffered) { - return true } else { return false } diff --git a/test/only-non-tap-output.js b/test/only-non-tap-output.js index 5d3af6e1f..7f201fb77 100644 --- a/test/only-non-tap-output.js +++ b/test/only-non-tap-output.js @@ -3,7 +3,7 @@ if (process.argv[2] === 'child') { } else if (process.argv[2] !== 'silent') { var t = require('../') var Test = t.Test - var tt = new Test() + var tt = new Test({ buffered: false }) var out = '' tt.on('data', function (c) {