diff --git a/test/addons-napi/test_constructor/test.js b/test/addons-napi/test_constructor/test.js index 92440bf49e74c1..26083db7a28a21 100644 --- a/test/addons-napi/test_constructor/test.js +++ b/test/addons-napi/test_constructor/test.js @@ -22,14 +22,14 @@ const propertyNames = []; for (const name in test_object) { propertyNames.push(name); } -assert.ok(propertyNames.indexOf('echo') >= 0); -assert.ok(propertyNames.indexOf('readwriteValue') >= 0); -assert.ok(propertyNames.indexOf('readonlyValue') >= 0); -assert.ok(propertyNames.indexOf('hiddenValue') < 0); -assert.ok(propertyNames.indexOf('readwriteAccessor1') < 0); -assert.ok(propertyNames.indexOf('readwriteAccessor2') < 0); -assert.ok(propertyNames.indexOf('readonlyAccessor1') < 0); -assert.ok(propertyNames.indexOf('readonlyAccessor2') < 0); +assert.ok(propertyNames.includes('echo')); +assert.ok(propertyNames.includes('readwriteValue')); +assert.ok(propertyNames.includes('readonlyValue')); +assert.ok(!propertyNames.includes('hiddenValue')); +assert.ok(!propertyNames.includes('readwriteAccessor1')); +assert.ok(!propertyNames.includes('readwriteAccessor2')); +assert.ok(!propertyNames.includes('readonlyAccessor1')); +assert.ok(!propertyNames.includes('readonlyAccessor2')); // The napi_writable attribute should be ignored for accessors. test_object.readwriteAccessor1 = 1; diff --git a/test/addons-napi/test_properties/test.js b/test/addons-napi/test_properties/test.js index 868c603879f1a2..a8127a27860eb3 100644 --- a/test/addons-napi/test_properties/test.js +++ b/test/addons-napi/test_properties/test.js @@ -21,14 +21,14 @@ const propertyNames = []; for (const name in test_object) { propertyNames.push(name); } -assert.ok(propertyNames.indexOf('echo') >= 0); -assert.ok(propertyNames.indexOf('readwriteValue') >= 0); -assert.ok(propertyNames.indexOf('readonlyValue') >= 0); -assert.ok(propertyNames.indexOf('hiddenValue') < 0); -assert.ok(propertyNames.indexOf('readwriteAccessor1') < 0); -assert.ok(propertyNames.indexOf('readwriteAccessor2') < 0); -assert.ok(propertyNames.indexOf('readonlyAccessor1') < 0); -assert.ok(propertyNames.indexOf('readonlyAccessor2') < 0); +assert.ok(propertyNames.includes('echo')); +assert.ok(propertyNames.includes('readwriteValue')); +assert.ok(propertyNames.includes('readonlyValue')); +assert.ok(!propertyNames.includes('hiddenValue')); +assert.ok(!propertyNames.includes('readwriteAccessor1')); +assert.ok(!propertyNames.includes('readwriteAccessor2')); +assert.ok(!propertyNames.includes('readonlyAccessor1')); +assert.ok(!propertyNames.includes('readonlyAccessor2')); // The napi_writable attribute should be ignored for accessors. test_object.readwriteAccessor1 = 1;