Skip to content

Commit 84efadf

Browse files
RamirezAlextargos
authored andcommitted
test, util: refactor isObject in test-util
refactor the test for isObject function including falsy values, the use of strictEquals and the format actual, expected PR-URL: #28878 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0b6a84a commit 84efadf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/parallel/test-util.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ assert.strictEqual(util.isError([]), false);
7373
assert.strictEqual(util.isError(Object.create(Error.prototype)), true);
7474

7575
// isObject
76-
assert.ok(util.isObject({}) === true);
76+
assert.strictEqual(util.isObject({}), true);
77+
assert.strictEqual(util.isObject([]), true);
78+
assert.strictEqual(util.isObject(new Number(3)), true);
79+
assert.strictEqual(util.isObject(Number(4)), false);
80+
assert.strictEqual(util.isObject(1), false);
7781

7882
// isPrimitive
7983
assert.strictEqual(util.isPrimitive({}), false);

0 commit comments

Comments
 (0)