Skip to content

Commit

Permalink
test(internal): Accommodate property-based testing attempts to delete…
Browse files Browse the repository at this point in the history
… an Array's `length`

Ref #10807
  • Loading branch information
gibson042 committed Feb 28, 2025
1 parent a27f724 commit b835538
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/internal/test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,13 @@ const {
(expectation, prop) => {
if (!isObject(expectation.specimen)) expectation.specimen = {};
if (!isObject(expectation.permit)) expectation.permit = { [prop]: true };
delete expectation.specimen[prop];
expectation.problem = 'specimen missing key';
try {
// The "length" property of an array is not configurable, so give accept
// failure as an option.
delete expectation.specimen[prop];
expectation.problem = 'specimen missing key';
// eslint-disable-next-line no-empty
} catch (err) {}
return expectation;
},
).filter(
Expand Down

0 comments on commit b835538

Please sign in to comment.