Files
scriptc/tests/fixtures/node-test/cases/assert-dyn.ts
Chris Tate 6b6445ab90 Retire the "DOM" nickname in comments, internal docs, and message prose: the checked-dynamic tree / dyn values
- The ratified rename rider (world-unification §7 lane 5): "DOM" collided with the browser DOM and, post-lane-1, the structure is no longer a document tree. Comments and doc prose now say "the checked-dynamic tree" for the noun and "dyn" adjectivally; runtime symbol names (scr_dyn_*), the error.domClone libCall, and the real web DOMException family are unchanged.
- The few user-facing strings carrying the nickname move with it (the structuredClone cyclic message, the dc subscriber/publish fences, two emitter ICE texts); diagnostics snapshots regenerated (96 pass). One private compiler constant (DOM_PROTO_METHOD_NAMES -> DYN_PROTO_METHOD_NAMES) rides along.
- Mechanical sweep, 142 files, comments/prose only — no behavior change.
2026-07-24 11:14:58 -05:00

42 lines
1.2 KiB
TypeScript

// @exit: 1
// Checked-dynamic asserts INSIDE node:test bodies — untyped JS's most
// common assert form running where it matters: strictEqual(dynValue,
// scalar) passes and fails with Node's exact AssertionError messages in
// the failing section (the generated multi-line diff included), the
// deep pair walks the checked-dynamic tree against static literals, and truthiness rides
// assert(dynValue).
import assert from "node:assert";
import { test } from "node:test";
const cfg: unknown = JSON.parse('{"port":8080,"host":"localhost","tags":["a","b"],"debug":false}');
const port: unknown = JSON.parse("8080");
test("dyn scalar assertions pass", () => {
assert.strictEqual(port, 8080);
assert.notStrictEqual(port, 8081);
assert(port);
});
test("dyn deep assertions pass", () => {
assert.deepStrictEqual(cfg, {
port: 8080,
host: "localhost",
tags: ["a", "b"],
debug: false,
});
assert.notDeepStrictEqual(cfg, { port: 8080 });
});
test("failing dyn strictEqual", () => {
assert.strictEqual(port, "8080");
});
test("failing dyn deepStrictEqual", () => {
assert.deepStrictEqual(cfg, {
port: 8081,
host: "localhost",
tags: ["a", "b"],
debug: false,
});
});