Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

733 B
Raw Blame
import { beforeAll, expect, test } from "bun:test";
import { install } from "../src/dom";

beforeAll(() => install());
const g = globalThis as any;

test("each tag makes its own class, a window global, as Chrome's (Excalidraw asks instanceof HTMLBRElement on every key)", () => {
  for (const [tag, name] of [["br", "HTMLBRElement"], ["p", "HTMLParagraphElement"], ["h2", "HTMLHeadingElement"], ["td", "HTMLTableCellElement"], ["div", "HTMLDivElement"]]) {
    const el = g.document.createElement(tag);
    expect(el instanceof g[name]).toBe(true);
    expect(el instanceof g.HTMLElement).toBe(true);
    expect(el.constructor.name).toBe(name);
  }
  expect(g.document.createElement("p") instanceof g.HTMLBRElement).toBe(false);
});