Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415// Globals for the Rust tests of @burokku/react, which render with// createElement since their scripts are plain JavaScript.import { Activity, createElement, useState } from "react";import { createRoot, flushSync } from "@burokku/react";import type { BurokkuNode } from "@burokku/runtime";
/** A node's subtree as `tag(children)`, with text nodes as JSON strings. */function describe(node: BurokkuNode): string { if ("data" in node) return JSON.stringify(node.data); const name = "localName" in node ? node.localName : "app"; return `${name}(${node.childNodes.map(child => describe(child)).join(",")})`;}
Object.assign(globalThis, { h: createElement, useState, Activity, createRoot, flushSync, describe });