Skip to content

Commit

Permalink
test(query_builder): add proper assertion for orderByRandom
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Sep 6, 2024
1 parent d283d16 commit e3d9c7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/database/query_builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5474,15 +5474,15 @@ test.group('Query Builder | orderByRandom', (group) => {
},
])

const users = []
const userResults: number[][] = []

for (let i = 0; i < 10; i++) {
const result = await db.from('users').orderByRandom()

users.push(result.map((user) => user.id))
userResults.push(result.map((user) => user.id))
}

// TODO: Check which assertion is better to use
assert.isTrue(userResults.some((users) => userResults[0] !== users))

await connection.disconnect()
})
Expand Down

0 comments on commit e3d9c7e

Please sign in to comment.