From bd5cacde324945cfbce314be64128d4d6873c8a8 Mon Sep 17 00:00:00 2001 From: George MacKerron Date: Fri, 10 Jan 2025 17:35:50 +0000 Subject: [PATCH] Switched apt for apt-get in CI, and format:fix --- .github/workflows/test.yml | 2 +- tests/packages/prisma/http.test.ts | 6 ++++-- tests/packages/prisma/ws.test.ts | 12 +++++++----- tests/vercel/vercel.test.ts | 6 +++++- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c50b387..77935c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: - name: Install package dependencies run: | # strip Prisma, whose preinstall script throws on Node versions less than 18.x - sudo apt install jq + sudo apt-get install jq jq 'del(.devDependencies.prisma, .devDependencies."@prisma/client")' package.json > tmp.json mv tmp.json package.json npm install diff --git a/tests/packages/prisma/http.test.ts b/tests/packages/prisma/http.test.ts index 68a096c..f32136f 100644 --- a/tests/packages/prisma/http.test.ts +++ b/tests/packages/prisma/http.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { neon } from '@neondatabase/serverless'; // see package.json: this points to 'file:../../../dist/npm' +import { neon } from '@neondatabase/serverless'; // see package.json: this points to 'file:../../../dist/npm' import { PrismaNeonHTTP } from '@prisma/adapter-neon'; import { PrismaClient } from '@prisma/client'; @@ -10,7 +10,9 @@ test('basic query using Prisma with http', async () => { const adapter = new PrismaNeonHTTP(sql); const prisma = new PrismaClient({ adapter }); const tzName = 'Europe/London'; - const result = await prisma.pg_timezone_names.findFirst({ where: { name: tzName } }); + const result = await prisma.pg_timezone_names.findFirst({ + where: { name: tzName }, + }); expect(result!.name).toBe(tzName); expect(result!.abbrev).toBeTypeOf('string'); expect(result!.is_dst).toBeTypeOf('boolean'); diff --git a/tests/packages/prisma/ws.test.ts b/tests/packages/prisma/ws.test.ts index 172ab4a..402f025 100644 --- a/tests/packages/prisma/ws.test.ts +++ b/tests/packages/prisma/ws.test.ts @@ -1,5 +1,5 @@ import { expect, test } from 'vitest'; -import { Pool } from '@neondatabase/serverless'; // see package.json: this points to 'file:../../../dist/npm' +import { Pool } from '@neondatabase/serverless'; // see package.json: this points to 'file:../../../dist/npm' import { PrismaNeon } from '@prisma/adapter-neon'; import { PrismaClient } from '@prisma/client'; @@ -12,19 +12,21 @@ test('basic query using Prisma with WebSockets', async () => { // manually, because the `instanceof` check it performs throws an error (is // it running in a different context, perhaps?) - // not: + // not: // const adapter = new PrismaNeon(pool); // instead: const adapter = Object.create(PrismaNeon.prototype); - adapter.adapterName = "@prisma/adapter-neon"; - adapter.provider = "postgres"; + adapter.adapterName = '@prisma/adapter-neon'; + adapter.provider = 'postgres'; adapter.client = pool; adapter.isRunning = true; const prisma = new PrismaClient({ adapter }); const tzName = 'Europe/London'; - const result = await prisma.pg_timezone_names.findFirst({ where: { name: tzName } }); + const result = await prisma.pg_timezone_names.findFirst({ + where: { name: tzName }, + }); expect(result!.name).toBe(tzName); expect(result!.abbrev).toBeTypeOf('string'); expect(result!.is_dst).toBeTypeOf('boolean'); diff --git a/tests/vercel/vercel.test.ts b/tests/vercel/vercel.test.ts index 895f66f..4c43816 100644 --- a/tests/vercel/vercel.test.ts +++ b/tests/vercel/vercel.test.ts @@ -94,7 +94,11 @@ test( }); status = statusResponse.status; host = statusResponse.url; - } while (status === 'QUEUED' || status === 'BUILDING' || status === 'INITIALIZING'); + } while ( + status === 'QUEUED' || + status === 'BUILDING' || + status === 'INITIALIZING' + ); if (status !== 'READY') { throw new Error(`Unexpected deployment status: ${status}`);