From d463f02bc78bd90d4149a1888e19e9a8159b44d7 Mon Sep 17 00:00:00 2001 From: Ferdinand Holzer Date: Sun, 24 May 2020 22:25:01 +0200 Subject: [PATCH] src: fix testEnumerables on ObjectWrap PR-URL: https://github.com/nodejs/node-addon-api/pull/736 Reviewed-By: Michael Dawson --- test/objectwrap.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/objectwrap.js b/test/objectwrap.js index a1a56136f..02abf60b9 100644 --- a/test/objectwrap.js +++ b/test/objectwrap.js @@ -108,11 +108,15 @@ const test = (binding) => { keys.push(key); } - assert(keys.length = 4); - assert(obj.testGetSet); - assert(obj.testGetter); - assert(obj.testValue); - assert(obj.testMethod); + assert(keys.length == 6); + // on prototype + assert(keys.includes("testGetSet")); + assert(keys.includes("testGetter")); + assert(keys.includes("testValue")); + assert(keys.includes("testMethod")); + // on object only + assert(keys.includes("ownProperty")); + assert(keys.includes("ownPropertyT")); } };