Skip to content

Commit d22b5fc

Browse files
committed
Minor test tweaks due to output differences in v1 vs v4.
1 parent 8b3c1b7 commit d22b5fc

File tree

1 file changed

+22
-38
lines changed

1 file changed

+22
-38
lines changed

test/throws.js

+22-38
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ tape('throws (Function match)', function (t) {
3030
});
3131

3232
tap.test('failures', function (tt) {
33-
tt.plan(1);
34-
3533
var test = tape.createHarness();
3634
test.createStream().pipe(concat(function (body) {
3735
tt.equal(
@@ -41,73 +39,57 @@ tap.test('failures', function (tt) {
4139
+ 'not ok 1 should throw\n'
4240
+ ' ---\n'
4341
+ ' operator: throws\n'
44-
+ ' expected: |-\n'
45-
+ ' undefined\n'
46-
+ ' actual: |-\n'
47-
+ " { [TypeError: " + getNonFunctionMessage() + "] message: '" + getNonFunctionMessage() + "' }\n"
42+
+ ' expected: \n'
43+
+ " actual: {\"message\":\"" + getNonFunctionMessage() + '"}\n'
4844
+ ' ...\n'
4945
+ 'not ok 2 should throw\n'
5046
+ ' ---\n'
5147
+ ' operator: throws\n'
52-
+ ' expected: |-\n'
53-
+ ' undefined\n'
54-
+ ' actual: |-\n'
55-
+ " { [TypeError: " + getNonFunctionMessage(null) + "] message: '" + getNonFunctionMessage(null) + "' }\n"
48+
+ ' expected: \n'
49+
+ " actual: {\"message\":\"" + getNonFunctionMessage(null) + '"}\n'
5650
+ ' ...\n'
5751
+ 'not ok 3 should throw\n'
5852
+ ' ---\n'
5953
+ ' operator: throws\n'
60-
+ ' expected: |-\n'
61-
+ ' undefined\n'
62-
+ ' actual: |-\n'
63-
+ " { [TypeError: " + getNonFunctionMessage(true) + "] message: '" + getNonFunctionMessage(true) + "' }\n"
54+
+ ' expected: \n'
55+
+ " actual: {\"message\":\"" + getNonFunctionMessage(true) + '"}\n'
6456
+ ' ...\n'
6557
+ 'not ok 4 should throw\n'
6658
+ ' ---\n'
6759
+ ' operator: throws\n'
68-
+ ' expected: |-\n'
69-
+ ' undefined\n'
70-
+ ' actual: |-\n'
71-
+ " { [TypeError: " + getNonFunctionMessage(false) + "] message: '" + getNonFunctionMessage(false) + "' }\n"
60+
+ ' expected: \n'
61+
+ " actual: {\"message\":\"" + getNonFunctionMessage(false) + '"}\n'
7262
+ ' ...\n'
7363
+ 'not ok 5 should throw\n'
7464
+ ' ---\n'
7565
+ ' operator: throws\n'
76-
+ ' expected: |-\n'
77-
+ ' undefined\n'
78-
+ ' actual: |-\n'
79-
+ " { [TypeError: " + getNonFunctionMessage('abc') + "] message: '" + getNonFunctionMessage('abc') + "' }\n"
66+
+ ' expected: \n'
67+
+ " actual: {\"message\":\"" + getNonFunctionMessage('abc') + '"}\n'
8068
+ ' ...\n'
8169
+ 'not ok 6 should throw\n'
8270
+ ' ---\n'
8371
+ ' operator: throws\n'
84-
+ ' expected: |-\n'
85-
+ ' undefined\n'
86-
+ ' actual: |-\n'
87-
+ " { [TypeError: " + getNonFunctionMessage(/a/g) + "] message: '" + getNonFunctionMessage(/a/g) + "' }\n"
72+
+ ' expected: \n'
73+
+ " actual: {\"message\":\"" + getNonFunctionMessage(/a/g) + '"}\n'
8874
+ ' ...\n'
8975
+ 'not ok 7 should throw\n'
9076
+ ' ---\n'
9177
+ ' operator: throws\n'
92-
+ ' expected: |-\n'
93-
+ ' undefined\n'
94-
+ ' actual: |-\n'
95-
+ " { [TypeError: " + getNonFunctionMessage([]) + "] message: '" + getNonFunctionMessage([]) + "' }\n"
78+
+ ' expected: \n'
79+
+ " actual: {\"message\":\"" + getNonFunctionMessage([]) + '"}\n'
9680
+ ' ...\n'
9781
+ 'not ok 8 should throw\n'
9882
+ ' ---\n'
9983
+ ' operator: throws\n'
100-
+ ' expected: |-\n'
101-
+ ' undefined\n'
102-
+ ' actual: |-\n'
103-
+ " { [TypeError: " + getNonFunctionMessage({}) + "] message: '" + getNonFunctionMessage({}) + "' }\n"
84+
+ ' expected: \n'
85+
+ " actual: {\"message\":\"" + getNonFunctionMessage({}) + '"}\n'
10486
+ ' ...\n'
10587
+ '# function\n'
10688
+ 'not ok 9 should throw\n'
10789
+ ' ---\n'
10890
+ ' operator: throws\n'
109-
+ ' expected: undefined\n'
110-
+ ' actual: undefined\n'
91+
+ ' expected: \n'
92+
+ ' actual: \n'
11193
+ ' ...\n\n'
11294
+ '1..9\n'
11395
+ '# tests 9\n'
@@ -117,7 +99,6 @@ tap.test('failures', function (tt) {
11799
}));
118100

119101
test('non functions', function (t) {
120-
t.plan(8);
121102
t.throws();
122103
t.throws(null);
123104
t.throws(true);
@@ -126,10 +107,13 @@ tap.test('failures', function (tt) {
126107
t.throws(/a/g);
127108
t.throws([]);
128109
t.throws({});
110+
t.end();
129111
});
130112

131113
test('function', function (t) {
132-
t.plan(1);
133114
t.throws(function () {});
115+
t.end();
134116
});
117+
118+
tt.end();
135119
});

0 commit comments

Comments
 (0)