test: replace equal with strictEqual
PR-URL: https://github.com/nodejs/node/pull/32727 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
cbe955c227
commit
9c25ab1d30
@ -1,8 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('../common');
|
require('../common');
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert');
|
||||||
/* eslint-disable no-restricted-properties */
|
|
||||||
|
|
||||||
// Test that assert.ifError has the correct stack trace of both stacks.
|
// Test that assert.ifError has the correct stack trace of both stacks.
|
||||||
|
|
||||||
@ -26,12 +25,13 @@ const stack = err.stack;
|
|||||||
try {
|
try {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
assert.equal(e.message, 'ifError got unwanted exception: test error');
|
assert.strictEqual(e.message,
|
||||||
assert.equal(err.message, msg);
|
'ifError got unwanted exception: test error');
|
||||||
assert.equal(e.actual, err);
|
assert.strictEqual(err.message, msg);
|
||||||
assert.equal(e.actual.stack, stack);
|
assert.strictEqual(e.actual, err);
|
||||||
assert.equal(e.expected, null);
|
assert.strictEqual(e.actual.stack, stack);
|
||||||
assert.equal(e.operator, 'ifError');
|
assert.strictEqual(e.expected, null);
|
||||||
|
assert.strictEqual(e.operator, 'ifError');
|
||||||
threw = true;
|
threw = true;
|
||||||
}
|
}
|
||||||
assert(threw);
|
assert(threw);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user