From a00eee37b490b89ac6038a9119a467b8adc4dbb4 Mon Sep 17 00:00:00 2001 From: ZYSzys <17367077526@163.com> Date: Fri, 7 Sep 2018 10:47:15 +0800 Subject: [PATCH] test: test undefined in util PR-URL: https://github.com/nodejs/node/pull/22741 Reviewed-By: Gus Caplan Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Michael Dawson Reviewed-By: Sakthipriyan Vairamani --- test/parallel/test-util.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 337cb789f73656..2f91417d106148 100644 --- a/test/parallel/test-util.js +++ b/test/parallel/test-util.js @@ -113,14 +113,17 @@ assert.strictEqual(util.isBoolean(false), true); assert.strictEqual(util.isBoolean('string'), false); assert.strictEqual(util.isNull(null), true); +assert.strictEqual(util.isNull(undefined), false); assert.strictEqual(util.isNull(), false); assert.strictEqual(util.isNull('string'), false); +assert.strictEqual(util.isUndefined(undefined), true); assert.strictEqual(util.isUndefined(), true); assert.strictEqual(util.isUndefined(null), false); assert.strictEqual(util.isUndefined('string'), false); assert.strictEqual(util.isNullOrUndefined(null), true); +assert.strictEqual(util.isNullOrUndefined(undefined), true); assert.strictEqual(util.isNullOrUndefined(), true); assert.strictEqual(util.isNullOrUndefined('string'), false);