Skip to content

Commit 3f8b8a6

Browse files
committed
Use OpenWorker type in test
1 parent d00f255 commit 3f8b8a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/node/tests/PowerSyncDatabase.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import fs from 'node:fs/promises';
44
import { vi, expect, test, onTestFinished } from 'vitest';
55
import { AppSchema, createTempDir, databaseTest } from './utils';
66
import { PowerSyncDatabase } from '../lib';
7+
import { OpenWorker } from '../lib/db/options';
78

89
test('validates options', async () => {
910
await expect(async () => {
@@ -20,7 +21,9 @@ test('validates options', async () => {
2021

2122
test('can customize loading workers', async () => {
2223
const directory = await createTempDir();
23-
const openFunction = vi.fn((...args: ConstructorParameters<typeof Worker>) => new Worker(...args));
24+
const defaultWorker: OpenWorker = (...args) => new Worker(...args);
25+
26+
const openFunction = vi.fn(defaultWorker); // Wrap in vi.fn to count invocations
2427

2528
const database = new PowerSyncDatabase({
2629
schema: AppSchema,

0 commit comments

Comments
 (0)