Skip to content

Commit 750b63d

Browse files
committed
Make various random tests pass when TAP_BUFFER=1
1 parent a3bb777 commit 750b63d

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

test/segv.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ test('setup', function (t) {
5252
})
5353

5454
test('segv', function (t) {
55-
var tt = new Test({ bail: false })
55+
var tt = new Test({ bail: false, buffered: false })
5656
tt.spawn('./segv')
5757
var res = ''
5858
tt.on('data', function (c) {
@@ -81,7 +81,6 @@ test('segv', function (t) {
8181
})
8282

8383
test('cleanup', function (t) {
84-
return t.end()
8584
t.plan(2)
8685
fs.unlink('segv', function (er) {
8786
t.ifError(er, 'clean up segv')

test/test-test.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,24 @@ test('testing the test object', function (t) {
8282

8383
test('plan stuff', function (t) {
8484
t.throws(function () {
85-
var tt = new Test()
85+
var tt = new Test({ buffered: false })
8686
tt.plan(1)
8787
tt.plan(1)
8888
}, new Error('Cannot set plan more than once'))
8989
t.throws(function () {
90-
var tt = new Test()
90+
var tt = new Test({ buffered: false })
9191
tt.plan('foo')
9292
}, new TypeError('plan must be a number'))
9393
t.throws(function () {
94-
var tt = new Test()
94+
var tt = new Test({ buffered: false })
9595
tt.plan(-1)
9696
}, new TypeError('plan must be a number'))
9797

9898
t.end()
9999
})
100100

101101
test('do nothing after bailout', function (t) {
102-
var tt = new Test()
102+
var tt = new Test({ buffered: false })
103103
var out = ''
104104
tt.on('data', function (c) {
105105
out += c
@@ -117,7 +117,7 @@ test('do nothing after bailout', function (t) {
117117
})
118118

119119
test('subtest without arguments', function (t) {
120-
var tt = new Test()
120+
var tt = new Test({ buffered: false })
121121
var out = ''
122122
tt.on('data', function (c) {
123123
out += c
@@ -131,7 +131,7 @@ test('subtest without arguments', function (t) {
131131
})
132132

133133
test('subtest with only a name', function (t) {
134-
var tt = new Test()
134+
var tt = new Test({ buffered: false })
135135
var out = ''
136136
tt.on('data', function (c) {
137137
out += c
@@ -145,7 +145,7 @@ test('subtest with only a name', function (t) {
145145
})
146146

147147
test('subtest with only options', function (t) {
148-
var tt = new Test()
148+
var tt = new Test({ buffered: false })
149149
var out = ''
150150
tt.on('data', function (c) {
151151
out += c
@@ -159,7 +159,7 @@ test('subtest with only options', function (t) {
159159
})
160160

161161
test('subtest with only a function', function (t) {
162-
var tt = new Test()
162+
var tt = new Test({ buffered: false })
163163
var out = ''
164164
tt.on('data', function (c) {
165165
out += c
@@ -173,7 +173,7 @@ test('subtest with only a function', function (t) {
173173
})
174174

175175
test('subtest with name and options', function (t) {
176-
var tt = new Test()
176+
var tt = new Test({ buffered: false })
177177
var out = ''
178178
tt.on('data', function (c) {
179179
out += c
@@ -187,7 +187,7 @@ test('subtest with name and options', function (t) {
187187
})
188188

189189
test('subtest with name and function', function (t) {
190-
var tt = new Test()
190+
var tt = new Test({ buffered: false })
191191
var out = ''
192192
tt.on('data', function (c) {
193193
out += c
@@ -201,7 +201,7 @@ test('subtest with name and function', function (t) {
201201
})
202202

203203
test('subtest with options and function', function (t) {
204-
var tt = new Test()
204+
var tt = new Test({ buffered: false })
205205
var out = ''
206206
tt.on('data', function (c) {
207207
out += c
@@ -216,7 +216,7 @@ test('subtest with options and function', function (t) {
216216

217217
test('invalid test arguments', function (t) {
218218
t.throws(function () {
219-
var tt = new Test()
219+
var tt = new Test({ buffered: false })
220220
tt.test('name', { skip: false }, 'not a function')
221221
}, new TypeError('test() callback must be function if provided'))
222222

@@ -228,7 +228,7 @@ test('throws type', function (t) {
228228
throw new TypeError('some type error');
229229
}, TypeError, 'should throw a TypeError');
230230

231-
var tt = new Test()
231+
var tt = new Test({ buffered: false })
232232
t.notOk(tt.throws(function () {
233233
throw new RangeError('x')
234234
}, TypeError))

test/timeout.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tap.test('t.setTimeout()', function (t) {
4040
tt.setTimeout('not a number')
4141
}, {}, { message: 'setTimeout: number > 0 required' })
4242

43-
var tt = new Test({ timeout: 1000, bail: false })
43+
var tt = new Test({ timeout: 1000, bail: false, buffered: false })
4444
tt.setTimeout(2000)
4545
tt.setTimeout(Infinity)
4646
t.notOk(tt._timeout)
@@ -58,7 +58,7 @@ tap.test('t.setTimeout()', function (t) {
5858
' # failed 1 of 2 tests\n' +
5959
'not ok 1 - child test # time=')
6060

61-
tt = new Test({ name: 'some name', bail: false })
61+
tt = new Test({ name: 'some name', bail: false, buffered: false })
6262
tt.test('child test', { bail: false }, function (tt) {
6363
tt.pass('this is fine')
6464
})

0 commit comments

Comments
 (0)