From ab7d8fcc48f5727961a0f09442d6ae4c5f9b5a17 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 13 Jun 2019 16:05:00 -0400 Subject: [PATCH] src: fix objectwrap test case Refs: https://github.com/nodejs/node-addon-api/issues/485 The test case was relyingon the ordering of "for in" which is not guarranteed as per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in Update the testcase to check in an way that does not depend on ordering. PR-URL: https://github.com/nodejs/node-addon-api/pull/495 Refs: https://github.com/nodejs/node-addon-api/issues/485 Reviewed-By: Gabriel Schulhof Reviewed-By: NickNaso --- test/objectwrap.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/objectwrap.js b/test/objectwrap.js index 1f888234d..aa6d8d3cb 100644 --- a/test/objectwrap.js +++ b/test/objectwrap.js @@ -73,12 +73,11 @@ const test = (binding) => { keys.push(key); } - assert.deepEqual(keys, [ - 'testGetSet', - 'testGetter', - 'testValue', - 'testMethod' - ]); + assert(keys.length = 4); + assert(obj.testGetSet); + assert(obj.testGetter); + assert(obj.testValue); + assert(obj.testMethod); } };