Skip to content
Browse files

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 <>
Reviewed-By: Yuta Hiroto <>
Reviewed-By: Yongsheng Zhang <>
Reviewed-By: Rich Trott <>
Reviewed-By: Colin Ihrig <>
Reviewed-By: James M Snell <>
  • Loading branch information...
RamirezAlex authored and targos committed Jul 27, 2019
1 parent 0b6a84a commit 84efadf26372f146b8d687d98096fdbaaac91aea
Showing with 5 additions and 1 deletion.
  1. +5 −1 test/parallel/test-util.js
@@ -73,7 +73,11 @@ assert.strictEqual(util.isError([]), false);
assert.strictEqual(util.isError(Object.create(Error.prototype)), true);

// isObject
assert.ok(util.isObject({}) === true);
assert.strictEqual(util.isObject({}), true);
assert.strictEqual(util.isObject([]), true);
assert.strictEqual(util.isObject(new Number(3)), true);
assert.strictEqual(util.isObject(Number(4)), false);
assert.strictEqual(util.isObject(1), false);

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

0 comments on commit 84efadf

Please sign in to comment.
You can’t perform that action at this time.