mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
16 lines
478 B
TypeScript
16 lines
478 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import * as Comlink from "comlink";
|
|
import { join } from "path";
|
|
|
|
describe("comlink", () => {
|
|
test("should start without big delay", async () => {
|
|
const worker = new Worker(join(import.meta.dir, "worker.fixture.ts"));
|
|
const obj = Comlink.wrap(worker);
|
|
const start = performance.now();
|
|
//@ts-ignore
|
|
await obj.counter;
|
|
const end = performance.now();
|
|
expect(end - start).toBeLessThan(100);
|
|
});
|
|
});
|