From e79e6e9f29de60330147e766cca4d4699f7c0e3b Mon Sep 17 00:00:00 2001 From: prodrigues Date: Fri, 30 Aug 2024 10:21:57 +0100 Subject: [PATCH] fix 'having' singlstore-prefixed.test.ts integration tests --- .../tests/singlestore/singlestore-common.ts | 14 +++++++------- .../tests/singlestore/singlestore-prefixed.test.ts | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/integration-tests/tests/singlestore/singlestore-common.ts b/integration-tests/tests/singlestore/singlestore-common.ts index 104064d7e..433c76f34 100644 --- a/integration-tests/tests/singlestore/singlestore-common.ts +++ b/integration-tests/tests/singlestore/singlestore-common.ts @@ -70,10 +70,9 @@ import { afterAll, beforeEach, describe, expect, expectTypeOf, test } from 'vite import { Expect, toLocalDate } from '~/utils.ts'; import type { Equal } from '~/utils.ts'; +import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; -import fs from 'fs'; - type TestSingleStoreDB = SingleStoreDatabase; @@ -190,8 +189,6 @@ const citiesMySchemaTable = mySchema.table('cities', { name: text('name').notNull(), }); - - let singlestoreContainer: Docker.Container; export async function createDockerDB(): Promise<{ connectionString: string; container: Docker.Container }> { const docker = new Docker(); @@ -209,7 +206,6 @@ export async function createDockerDB(): Promise<{ connectionString: string; cont docker.modem.followProgress(pullStream, (err) => (err ? reject(err) : resolve(err))) ); - singlestoreContainer = await docker.createContainer({ Image: image, Env: ['ROOT_PASSWORD=singlestore'], @@ -1269,7 +1265,11 @@ export function tests(driver?: string) { test('insert via db.execute + select via db.execute', async (ctx) => { const { db } = ctx.singlestore; - await db.execute(sql`insert into ${usersTable} (${new Name(usersTable.id.name)},${new Name(usersTable.name.name)}) values (1,${'John'})`); + await db.execute( + sql`insert into ${usersTable} (${new Name(usersTable.id.name)},${new Name( + usersTable.name.name, + )}) values (1,${'John'})`, + ); const result = await db.execute<{ id: number; name: string }>(sql`select id, name from ${usersTable}`); expect(result[0]).toEqual([{ id: 1, name: 'John' }]); @@ -1766,7 +1766,7 @@ export function tests(driver?: string) { .from(users2Table) .as('sq'); - const res = await db.select({ name: sq.name }).from(sq).orderBy(asc(users2Table.id)) + const res = await db.select({ name: sq.name }).from(sq).orderBy(asc(users2Table.id)); expect(res).toEqual([{ name: 'John modified' }, { name: 'Jane modified' }]); }); diff --git a/integration-tests/tests/singlestore/singlestore-prefixed.test.ts b/integration-tests/tests/singlestore/singlestore-prefixed.test.ts index 6336bc9de..95053748d 100644 --- a/integration-tests/tests/singlestore/singlestore-prefixed.test.ts +++ b/integration-tests/tests/singlestore/singlestore-prefixed.test.ts @@ -1049,6 +1049,7 @@ test('having', async () => { }]); await db.insert(users2Table).values([{ id: 1, name: 'John', cityId: 1 }, { id: 2, name: 'Jane', cityId: 1 }, { + id: 3, name: 'Jack', cityId: 2, }]);