Skip to content

Commit

Permalink
using order by for more reliable test-case
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Oct 11, 2024
1 parent a35803d commit b4d5585
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/connections/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ describe('Database Connection', () => {
});

test('Select data', async () => {
const { data } = await qb.select().from('persons').query();
const { data } = await qb
.select()
.from('persons')
.orderBy('id')
.query();

expect(data).toEqual([
{ id: 1, name: 'Visal', age: 25 },
{ id: 2, name: 'Outerbase', age: 30 },
Expand All @@ -86,7 +91,11 @@ describe('Database Connection', () => {
.where({ id: 1 })
.query();

const { data } = await qb.select().from('persons').query();
const { data } = await qb
.select()
.from('persons')
.orderBy('id')
.query();

expect(data).toEqual([
{ id: 1, name: 'Visal In', age: 25 },
Expand Down

0 comments on commit b4d5585

Please sign in to comment.