import { test, describe, afterEach, expect } from "vitest"; import { cleanup, render, waitFor } from "@self/tootils/render"; import HTML from "./Index.svelte"; describe("HTML shared head scripts", () => { afterEach(() => cleanup()); test("js_on_load waits for a head script another instance is already loading", async () => { const src = URL.createObjectURL( new Blob(["window.__shared_lib = true;"], { type: "application/javascript" }) ); const head = `