diff --git a/packages/typegen/test/helper.ts b/packages/typegen/test/helper.ts index 48149b4c..f12779c4 100644 --- a/packages/typegen/test/helper.ts +++ b/packages/typegen/test/helper.ts @@ -80,13 +80,10 @@ export const getPoolHelper = (params: {__filename: string; baseConnectionURI: st // afterAll(async () => new Promise(r => setTimeout(r, 1))) const setupDb = async () => { - const exists = Boolean(await admin.maybeOne(sql`select 1 from pg_database where datname = ${dbName}`)) - if (!exists) { - await admin.query(sql`create database ${sql.identifier([dbName])}`).catch(e => { - if (e.message.endsWith('unique_violation')) return - throw e - }) - } + await admin.query(sql`create database ${sql.identifier([dbName])}`).catch(e => { + if (e.message.endsWith('(unique_violation)')) return + throw e + }) await pool.query(sql` drop schema if exists ${schemaIdentifier} cascade; diff --git a/packages/typegen/test/watch.test.ts b/packages/typegen/test/watch.test.ts index 7fbfda4d..99c8f30c 100644 --- a/packages/typegen/test/watch.test.ts +++ b/packages/typegen/test/watch.test.ts @@ -2,7 +2,7 @@ import * as fs from 'fs' import * as fsSyncer from 'fs-syncer' import * as path from 'path' -import {test, beforeEach, expect, vi as jest} from 'vitest' +import {test as _test, beforeEach, expect, vi as jest} from 'vitest' import * as typegen from '../src' import {getPureHelper as getHelper} from './helper' @@ -14,6 +14,8 @@ beforeEach(async () => { await helper.setupDb() }) +const test = process.env.CI ? _test.skip : _test + test( 'watch file system', async () => {