Skip to content

Commit

Permalink
Switched apt for apt-get in CI, and format:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jawj committed Jan 10, 2025
1 parent 7e3b02d commit bd5cacd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tests/packages/prisma/http.test.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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');
Expand Down
12 changes: 7 additions & 5 deletions tests/packages/prisma/ws.test.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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');
Expand Down
6 changes: 5 additions & 1 deletion tests/vercel/vercel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit bd5cacd

Please sign in to comment.