From e3d9c7eec1ca3fa37beff03b96579c931fba4cd2 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Fri, 6 Sep 2024 08:16:13 +0200 Subject: [PATCH] test(query_builder): add proper assertion for orderByRandom --- test/database/query_builder.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/database/query_builder.spec.ts b/test/database/query_builder.spec.ts index 12e43eec..9fbc9192 100644 --- a/test/database/query_builder.spec.ts +++ b/test/database/query_builder.spec.ts @@ -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() })