Skip to content

Commit f6023b1

Browse files
committed
move some more random output tests to fixtures
1 parent 07f68dd commit f6023b1

File tree

41 files changed

+266
-102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+266
-102
lines changed

test/test-test.js

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -98,94 +98,6 @@ test('plan stuff', function (t) {
9898
t.end()
9999
})
100100

101-
test('do nothing after bailout', function (t) {
102-
var tt = new Test({ buffered: false })
103-
var out = ''
104-
tt.on('data', function (c) {
105-
out += c
106-
})
107-
tt.bailout('this is fine')
108-
tt.plan(9999)
109-
tt.test('nope', function (t) {
110-
throw new Error('should not get here')
111-
})
112-
tt.throws(function () {}, 'did not throw')
113-
tt.end()
114-
tt.plan(100)
115-
t.equal(out, 'TAP version 13\nBail out! # this is fine\n')
116-
t.end()
117-
})
118-
119-
test('subtest without arguments', function (t) {
120-
var tt = new Test({ buffered: false })
121-
var out = ''
122-
tt.on('data', function (c) {
123-
out += c
124-
})
125-
tt.test()
126-
tt.end()
127-
128-
t.match(out, /^TAP version 13\nok 1 - \(unnamed test\) # TODO\n1\.\.1\n$/)
129-
130-
t.end()
131-
})
132-
133-
test('subtest with only a name', function (t) {
134-
var tt = new Test({ buffered: false })
135-
var out = ''
136-
tt.on('data', function (c) {
137-
out += c
138-
})
139-
tt.test('name only')
140-
tt.end()
141-
142-
t.match(out, /^TAP version 13\nok 1 - name only # TODO\n1\.\.1\n$/)
143-
144-
t.end()
145-
})
146-
147-
test('subtest with only options', function (t) {
148-
var tt = new Test({ buffered: false })
149-
var out = ''
150-
tt.on('data', function (c) {
151-
out += c
152-
})
153-
tt.test({skip: true})
154-
tt.end()
155-
156-
t.match(out, /^TAP version 13\nok 1 - \(unnamed test\) # SKIP\n1\.\.1\n$/)
157-
158-
t.end()
159-
})
160-
161-
test('subtest with only a function', function (t) {
162-
var tt = new Test({ buffered: false })
163-
var out = ''
164-
tt.on('data', function (c) {
165-
out += c
166-
})
167-
tt.test(function (t){t.end()})
168-
tt.end()
169-
170-
t.equal(out, 'TAP version 13\n# Subtest: (unnamed test)\n 1..0\nok 1 - (unnamed test)\n\n1..1\n');
171-
172-
t.end()
173-
})
174-
175-
test('subtest with name and options', function (t) {
176-
var tt = new Test({ buffered: false })
177-
var out = ''
178-
tt.on('data', function (c) {
179-
out += c
180-
})
181-
tt.test('name', {skip: false})
182-
tt.end()
183-
184-
t.match(out, /^TAP version 13\nok 1 - name # TODO\n1\.\.1\n$/)
185-
186-
t.end()
187-
})
188-
189101
test('subtest with name and function', function (t) {
190102
var tt = new Test({ buffered: false })
191103
var out = ''
@@ -199,20 +111,6 @@ test('subtest with name and function', function (t) {
199111
t.end()
200112
})
201113

202-
test('subtest with options and function', function (t) {
203-
var tt = new Test({ buffered: false })
204-
var out = ''
205-
tt.on('data', function (c) {
206-
out += c
207-
})
208-
tt.test({skip: false}, function (t){t.end()})
209-
tt.end()
210-
211-
t.equal(out, 'TAP version 13\n# Subtest: (unnamed test)\n 1..0\nok 1 - (unnamed test)\n\n1..1\n');
212-
213-
t.end()
214-
})
215-
216114
test('invalid test arguments', function (t) {
217115
t.throws(function () {
218116
var tt = new Test({ buffered: false })
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TAP version 13
2+
Bail out! # this is fine
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TAP version 13
2+
Bail out! # this is fine
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TAP version 13
2+
Bail out! # this is fine
3+

test/test/bailout-with-stuff-after.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var t = require('../..')
2+
t.bailout('this is fine')
3+
t.plan(9999)
4+
t.test('nope', function (t) {
5+
throw new Error('should not get here')
6+
})
7+
t.throws(function () {}, 'did not throw')
8+
t.end()
9+
t.plan(100)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TAP version 13
2+
Bail out! # this is fine
3+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
TAP version 13
2+
ok 1 - (unnamed test) # SKIP
3+
---
4+
{"some":"diags"}
5+
...
6+
7+
1..1
8+
# skip: 1
9+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
TAP version 13
2+
ok 1 - (unnamed test) # SKIP
3+
---
4+
{"some":"diags"}
5+
...
6+
7+
1..1
8+
# skip: 1
9+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
TAP version 13
2+
ok 1 - (unnamed test) # SKIP
3+
---
4+
{"some":"diags"}
5+
...
6+
7+
1..1
8+
# skip: 1
9+

test/test/subtest-only-options.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var Test = require('../..').Test
2+
var t = new Test()
3+
t.pipe(process.stdout)
4+
t.test({ skip: true, some: 'diags', diagnostic: true })
5+
t.end()

0 commit comments

Comments
 (0)