You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both tests appear to have the same error - they are not using Set.add() to add the newly generated ID to the set so ids.has(id) is checking for the id in an empty Set.
const ids = new Set()
for (let i = 0; i < (cacheSize); ++i) {
const id = idGen()
if (ids.has(id)) {
t.fail('had a collision')
}
t.equal(id.length, 32)
}
I believe this should be: -
const ids = new Set()
for (let i = 0; i < (cacheSize); ++i) {
const id = idGen()
if (ids.has(id)) {
t.fail('had a collision')
}
t.equal(id.length, 32)
ids.add(id) <--------------------------------------------
}
The text was updated successfully, but these errors were encountered:
Prerequisites
Issue
https://github.com/fastify/session/blob/master/test/idGenerator.test.js
Both tests appear to have the same error - they are not using
Set.add()
to add the newly generated ID to the set soids.has(id)
is checking for theid
in an emptySet
.I believe this should be: -
The text was updated successfully, but these errors were encountered: