it("should allow to create a WebWorker", async () => {
	if (typeof window !== "undefined") {
		const worker = new Worker(new URL("./worker.js", import.meta.url), {
			type: "module"
		});
		worker.postMessage("ok");
		const result = await new Promise((resolve) => {
			worker.onmessage = (event) => {
				resolve(event.data);
			};
		});
		expect(result).toBe("data: OK, thanks");
		await worker.terminate();
	} else {
		expect(true).toBe(true);
	}
});

it("should allow to share chunks", async () => {
	const { upper } = await import("./module");
	expect(upper("ok")).toBe("OK");
});
