Files
bun.sh/test/js/third_party/comlink/comlink.test.ts
2024-09-03 21:32:52 -07:00

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);
});
});