import { expect, test } from "bun:test";
import { MOBILE_CLIENT } from "../src/runtime.ts";

test("native client is valid JavaScript and relays platform-specific event types", () => {
  expect(() => new Bun.Transpiler({ loader: "js" }).transformSync(MOBILE_CLIENT)).not.toThrow();
  expect(MOBILE_CLIENT).toContain("installNativeEvents(document)");
  expect(MOBILE_CLIENT).toContain("/^data-on-wrnexus-(?:browser|mobile)-(.+)$/");
  expect(MOBILE_CLIENT).toContain("document.addEventListener(type, handleNativeEvent, true)");
  expect(MOBILE_CLIENT).toContain('"wrnexus-" + nativeTarget + "-" + event.type');
});
