// SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie // SPDX-License-Identifier: MIT /** * The node runner for `tests.js`, which `zig build test-web` invokes. * * Usage: `node web/uri.test.js path/to/uri.wasm` * * The same suite runs in a real browser under `nix flake check`; see * `browser-test.html`. */ import { readFileSync } from "node:fs"; import { test } from "node:test"; import assert from "node:assert/strict"; import { hasUnicode, initSync } from "./uri.js"; import { suite } from "./tests.js"; const wasmPath = process.argv[2] ?? new URL("../zig-out/web/uri.wasm", import.meta.url); initSync(readFileSync(wasmPath)); console.log(`# uri.wasm from ${wasmPath}, unicode ${hasUnicode() ? "on" : "off"}`); suite({ test, assert });