Skip to content

Commit

Permalink
Transform compareArray -> assert.compareArray: test/built-ins/Reflect…
Browse files Browse the repository at this point in the history
…/**/*.js (#3232)
  • Loading branch information
rwaldron authored Oct 6, 2021
1 parent 891b791 commit 0f47fe4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ Object.defineProperty(o1, 'p', {

var result = Reflect.getOwnPropertyDescriptor(o1, 'p');

assert(
compareArray(
Object.getOwnPropertyNames(result), ['get', 'set', 'enumerable', 'configurable']
)
assert.compareArray(
Object.getOwnPropertyNames(result),
['get', 'set', 'enumerable', 'configurable']
);
assert.sameValue(result.enumerable, false);
assert.sameValue(result.configurable, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ var o1 = {

var result = Reflect.getOwnPropertyDescriptor(o1, 'p');

assert(
compareArray(
Object.getOwnPropertyNames(result), ['value', 'writable', 'enumerable', 'configurable']
)
assert.compareArray(
Object.getOwnPropertyNames(result),
['value', 'writable', 'enumerable', 'configurable']
);
assert.sameValue(result.value, 'foo');
assert.sameValue(result.enumerable, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ o[s] = 42;

var result = Reflect.getOwnPropertyDescriptor(o, s);

assert(
compareArray(
Object.getOwnPropertyNames(result), ['value', 'writable', 'enumerable', 'configurable']
)
assert.compareArray(
Object.getOwnPropertyNames(result),
['value', 'writable', 'enumerable', 'configurable']
);
assert.sameValue(result.value, 42);
assert.sameValue(result.enumerable, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ var o = Object.create(proto);
o.p1 = 42;
o.p2 = 43;
o.p3 = 44;
assert(
compareArray(Reflect.ownKeys(o), ['p1', 'p2', 'p3']),
'return object own keys'
);
assert.compareArray(Reflect.ownKeys(o), ['p1', 'p2', 'p3'], 'return object own keys');
4 changes: 2 additions & 2 deletions test/built-ins/Reflect/ownKeys/return-empty-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ includes: [compareArray.js]
features: [Reflect]
---*/

assert(compareArray(Reflect.ownKeys({}), []));
assert.compareArray(Reflect.ownKeys({}), []);

var o = {
d: 42
};
delete o.d;
assert(compareArray(Reflect.ownKeys(o), []));
assert.compareArray(Reflect.ownKeys(o), []);
12 changes: 5 additions & 7 deletions test/built-ins/Reflect/ownKeys/return-non-enumerable-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ includes: [compareArray.js]
features: [Reflect]
---*/

assert(
compareArray(Reflect.ownKeys([]), ['length']),
assert.compareArray(
Reflect.ownKeys([]),
['length'],
'return non enumerable `length` from empty array'
);

assert(
compareArray(Reflect.ownKeys([, , 2]), ['2', 'length']),
'return array keys'
);
assert.compareArray(Reflect.ownKeys([, , 2]), ['2', 'length'], 'return array keys');

var o = {};
Object.defineProperty(o, 'p1', {
Expand All @@ -35,4 +33,4 @@ Object.defineProperty(o, 'p2', {
enumerable: false
});

assert(compareArray(Reflect.ownKeys(o), ['p1', 'p2']));
assert.compareArray(Reflect.ownKeys(o), ['p1', 'p2']);

0 comments on commit 0f47fe4

Please sign in to comment.