Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/store-postgres/src/store.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFileSync } from 'node:fs';
import { PGlite } from '@electric-sql/pglite';
import { describe, expect, test } from 'vitest';
import { beforeAll, describe, expect, test } from 'vitest';
import { describeStore } from '../../core/test/store-contract.ts';
import { migrate } from './migrate.ts';
import type { Sql } from './sql.ts';
Expand All @@ -27,6 +27,12 @@ async function freshDatabase(): Promise<Sql> {
return sql;
}

// The first PGlite in a process compiles its WebAssembly, which can take seconds on a busy
// machine. Do it here, with its own time limit, so no test pays for it.
beforeAll(async () => {
await (await PGlite.create()).close();
}, 60_000);

describeStore('PostgresStore', async () => new PostgresStore(await freshDatabase()));

describe('migrate', () => {
Expand Down
Loading