Skip to content

Commit

Permalink
src: fix objectwrap test case
Browse files Browse the repository at this point in the history
Refs: nodejs#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: nodejs#495
Refs: nodejs#485
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>
  • Loading branch information
mhdawson committed Jun 13, 2019
1 parent 3b6b9eb commit ab7d8fc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/objectwrap.js
Expand Up @@ -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);
}
};

Expand Down

0 comments on commit ab7d8fc

Please sign in to comment.