]> zoso.dev Git - libnemo.git/commitdiff
Check strict equality to nullish values.
authorChris Duncan <chris@zoso.dev>
Fri, 6 Dec 2024 20:48:25 +0000 (12:48 -0800)
committerChris Duncan <chris@zoso.dev>
Fri, 6 Dec 2024 20:48:25 +0000 (12:48 -0800)
test/manage-rolodex.mjs

index aab06905a5380db122c56dbb4719da02dd4d4912..43b684cc3952247832bd39c9fc33d97e54f12c83 100644 (file)
@@ -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)
        })
 })