Skip to content

Commit

Permalink
fix: failed benchmark tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mew-ton committed May 17, 2024
1 parent 534fb16 commit 62d5af8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/has.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ function runBench({ percentOfCheckKeys, objectValues }: TestCaseOption) {

let index = 0

bench(`omit (complex object including ${objectValues} values, omit ${percentOfCheckKeys * 100}% of keys)`, () => {
bench(`has (complex object including ${objectValues} values, check ${percentOfCheckKeys * 100}% of keys)`, () => {
const currentIndex = index++ % iterations
// biome-ignore lint/style/noNonNullAssertion: <explanation>
const { object, keys } = testCases[currentIndex]!
has(object, keys)

for (const key of keys) {
has(object, key)
}
})
}

Expand Down

0 comments on commit 62d5af8

Please sign in to comment.