mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Fix db tests
This commit is contained in:
parent
773b5da461
commit
4e0bb16b85
2 changed files with 7 additions and 2 deletions
|
|
@ -2,9 +2,12 @@ import { assertEquals } from '@std/assert';
|
|||
|
||||
import { DittoPglite } from './DittoPglite.ts';
|
||||
|
||||
Deno.test('DittoPglite.create', () => {
|
||||
Deno.test('DittoPglite.create', async () => {
|
||||
const db = DittoPglite.create('memory://');
|
||||
|
||||
assertEquals(db.poolSize, 1);
|
||||
assertEquals(db.availableConnections, 1);
|
||||
|
||||
await db.kysely.destroy();
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ Deno.test('isWorker from the main thread returns false', () => {
|
|||
});
|
||||
|
||||
Deno.test('isWorker from a worker thread returns true', async () => {
|
||||
const url = new URL('./worker.ts', import.meta.url);
|
||||
|
||||
const script = `
|
||||
import { isWorker } from '@/utils/worker.ts';
|
||||
import { isWorker } from '${url.href}';
|
||||
postMessage(isWorker());
|
||||
self.close();
|
||||
`;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue