From 84efadf26372f146b8d687d98096fdbaaac91aea Mon Sep 17 00:00:00 2001 From: Alex Ramirez Date: Sat, 27 Jul 2019 14:02:30 -0500 Subject: [PATCH] test, util: refactor isObject in test-util MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor the test for isObject function including falsy values, the use of strictEquals and the format actual, expected PR-URL: https://github.com/nodejs/node/pull/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 --- test/parallel/test-util.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 39377f33cf0ad8..204b2bca5b9f3b 100644 --- a/test/parallel/test-util.js +++ b/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);