Skip to content

Commit df93d6b

Browse files
suryaghMylesBorins
authored andcommitted
test: assert - fixed error messages to match the tests
PR-URL: #6241 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
1 parent fb2a978 commit df93d6b

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

test/parallel/test-assert.js

+30-21
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,46 @@ assert.doesNotThrow(makeBlock(a.ok, true),
2727

2828
assert.doesNotThrow(makeBlock(a.ok, 'test'), 'ok(\'test\')');
2929

30-
assert.throws(makeBlock(a.equal, true, false), a.AssertionError, 'equal');
30+
assert.throws(makeBlock(a.equal, true, false),
31+
a.AssertionError, 'equal(true, false)');
3132

32-
assert.doesNotThrow(makeBlock(a.equal, null, null), 'equal');
33+
assert.doesNotThrow(makeBlock(a.equal, null, null),
34+
'equal(null, null)');
3335

34-
assert.doesNotThrow(makeBlock(a.equal, undefined, undefined), 'equal');
36+
assert.doesNotThrow(makeBlock(a.equal, undefined, undefined),
37+
'equal(undefined, undefined)');
3538

36-
assert.doesNotThrow(makeBlock(a.equal, null, undefined), 'equal');
39+
assert.doesNotThrow(makeBlock(a.equal, null, undefined),
40+
'equal(null, undefined)');
3741

38-
assert.doesNotThrow(makeBlock(a.equal, true, true), 'equal');
42+
assert.doesNotThrow(makeBlock(a.equal, true, true), 'equal(true, true)');
3943

40-
assert.doesNotThrow(makeBlock(a.equal, 2, '2'), 'equal');
44+
assert.doesNotThrow(makeBlock(a.equal, 2, '2'), 'equal(2, \'2\')');
4145

42-
assert.doesNotThrow(makeBlock(a.notEqual, true, false), 'notEqual');
46+
assert.doesNotThrow(makeBlock(a.notEqual, true, false),
47+
'notEqual(true, false)');
4348

4449
assert.throws(makeBlock(a.notEqual, true, true),
45-
a.AssertionError, 'notEqual');
50+
a.AssertionError, 'notEqual(true, true)');
4651

4752
assert.throws(makeBlock(a.strictEqual, 2, '2'),
48-
a.AssertionError, 'strictEqual');
53+
a.AssertionError, 'strictEqual(2, \'2\')');
4954

5055
assert.throws(makeBlock(a.strictEqual, null, undefined),
51-
a.AssertionError, 'strictEqual');
56+
a.AssertionError, 'strictEqual(null, undefined)');
5257

53-
assert.doesNotThrow(makeBlock(a.notStrictEqual, 2, '2'), 'notStrictEqual');
58+
assert.doesNotThrow(makeBlock(a.notStrictEqual, 2, '2'),
59+
'notStrictEqual(2, \'2\')');
5460

5561
// deepEquals joy!
5662
// 7.2
5763
assert.doesNotThrow(makeBlock(a.deepEqual, new Date(2000, 3, 14),
58-
new Date(2000, 3, 14)), 'deepEqual date');
64+
new Date(2000, 3, 14)),
65+
'deepEqual(new Date(2000, 3, 14), new Date(2000, 3, 14))');
5966

6067
assert.throws(makeBlock(a.deepEqual, new Date(), new Date(2000, 3, 14)),
6168
a.AssertionError,
62-
'deepEqual date');
69+
'deepEqual(new Date(), new Date(2000, 3, 14))');
6370

6471
// 7.3
6572
assert.doesNotThrow(makeBlock(a.deepEqual, /a/, /a/));
@@ -81,11 +88,11 @@ assert.throws(makeBlock(a.deepEqual, /a/igm, /a/im));
8188

8289

8390
// 7.4
84-
assert.doesNotThrow(makeBlock(a.deepEqual, 4, '4'), 'deepEqual == check');
85-
assert.doesNotThrow(makeBlock(a.deepEqual, true, 1), 'deepEqual == check');
91+
assert.doesNotThrow(makeBlock(a.deepEqual, 4, '4'), 'deepEqual(4, \'4\')');
92+
assert.doesNotThrow(makeBlock(a.deepEqual, true, 1), 'deepEqual(true, 1)');
8693
assert.throws(makeBlock(a.deepEqual, 4, '5'),
8794
a.AssertionError,
88-
'deepEqual == check');
95+
'deepEqual( 4, \'5\')');
8996

9097
// 7.5
9198
// having the same number of owned properties && the same set of keys
@@ -156,11 +163,13 @@ assert.doesNotThrow(makeBlock(a.deepEqual, new Boolean(true), {}),
156163

157164
//deepStrictEqual
158165
assert.doesNotThrow(makeBlock(a.deepStrictEqual, new Date(2000, 3, 14),
159-
new Date(2000, 3, 14)), 'deepStrictEqual date');
166+
new Date(2000, 3, 14)),
167+
'deepStrictEqual(new Date(2000, 3, 14),\
168+
new Date(2000, 3, 14))');
160169

161170
assert.throws(makeBlock(a.deepStrictEqual, new Date(), new Date(2000, 3, 14)),
162171
a.AssertionError,
163-
'deepStrictEqual date');
172+
'deepStrictEqual(new Date(), new Date(2000, 3, 14))');
164173

165174
// 7.3 - strict
166175
assert.doesNotThrow(makeBlock(a.deepStrictEqual, /a/, /a/));
@@ -183,15 +192,15 @@ assert.throws(makeBlock(a.deepStrictEqual, /a/igm, /a/im));
183192
// 7.4 - strict
184193
assert.throws(makeBlock(a.deepStrictEqual, 4, '4'),
185194
a.AssertionError,
186-
'deepStrictEqual === check');
195+
'deepStrictEqual(4, \'4\')');
187196

188197
assert.throws(makeBlock(a.deepStrictEqual, true, 1),
189198
a.AssertionError,
190-
'deepStrictEqual === check');
199+
'deepStrictEqual(true, 1)');
191200

192201
assert.throws(makeBlock(a.deepStrictEqual, 4, '5'),
193202
a.AssertionError,
194-
'deepStrictEqual === check');
203+
'deepStrictEqual(4, \'5\')');
195204

196205
// 7.5 - strict
197206
// having the same number of owned properties && the same set of keys

0 commit comments

Comments
 (0)