From 3e464c77d88a9badf893e02e6ec730abc7f0947b 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 --- test/database/query_builder.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/database/query_builder.spec.ts b/test/database/query_builder.spec.ts index 12e43eec..ad31c2af 100644 --- a/test/database/query_builder.spec.ts +++ b/test/database/query_builder.spec.ts @@ -5474,18 +5474,18 @@ 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() - }) + }).pin() }) test.group('Query Builder | offset', (group) => {