From: Chris Duncan Date: Fri, 6 Dec 2024 20:48:25 +0000 (-0800) Subject: Check strict equality to nullish values. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=cf5d287d4a794de827ac0d3607a62271f3cc2889;p=libnemo.git Check strict equality to nullish values. --- diff --git a/test/manage-rolodex.mjs b/test/manage-rolodex.mjs index aab0690..43b684c 100644 --- a/test/manage-rolodex.mjs +++ b/test/manage-rolodex.mjs @@ -73,23 +73,23 @@ test('rolodex valid contact management', async () => { test('should return null for an unknown address', async () => { const rolodex = new Rolodex() await rolodex.add('JohnDoe', NANO_TEST_VECTORS.ADDRESS_0) - assert.equals(rolodex.getName(NANO_TEST_VECTORS.ADDRESS_1), null) - assert.notEqual(rolodex.getName(NANO_TEST_VECTORS.ADDRESS_1), undefined) + assert.ok(rolodex.getName(NANO_TEST_VECTORS.ADDRESS_1) === null) + assert.ok(rolodex.getName(NANO_TEST_VECTORS.ADDRESS_1) !== undefined) }) test('should return null for a blank address', async () => { const rolodex = new Rolodex() await rolodex.add('JohnDoe', NANO_TEST_VECTORS.ADDRESS_0) //@ts-expect-error - assert.equals(rolodex.getName(undefined), null) + assert.ok(rolodex.getName(undefined) === null) //@ts-expect-error - assert.notEqual(rolodex.getName(undefined), undefined) + assert.ok(rolodex.getName(undefined) !== undefined) //@ts-expect-error - assert.equals(rolodex.getName(null), null) + assert.ok(rolodex.getName(null) === null) //@ts-expect-error - assert.notEqual(rolodex.getName(null), undefined) - assert.equals(rolodex.getName(''), null) - assert.notEqual(rolodex.getName(''), undefined) + assert.ok(rolodex.getName(null) !== undefined) + assert.ok(rolodex.getName('') === null) + assert.ok(rolodex.getName('') !== undefined) }) })