mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
Same rule and the same message as the native side: a key no element can carry throws instead of matching nothing. The accepted list is one list, committed as a fixture both suites assert, so a spec cannot be accepted by one runtime and rejected by the other.
22 lines
926 B
TypeScript
22 lines
926 B
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import { fileURLToPath } from "node:url";
|
|
import { test } from "node:test";
|
|
|
|
import { __testing__ } from "../src/web-runtime.ts";
|
|
|
|
const { SELECTOR_KEYS } = __testing__;
|
|
|
|
const goldenPath = fileURLToPath(new URL("./fixtures/selector-keys.json", import.meta.url));
|
|
const golden: string[] = JSON.parse(readFileSync(goldenPath, "utf8"));
|
|
|
|
// Both runtimes reject an object-selector key they do not know, so the two key
|
|
// lists have to be one list. Were they to drift, a spec would be accepted by
|
|
// the runtime that lists the key and fail the run on the one that does not, and
|
|
// the difference would only show on the platform nobody ran first.
|
|
// internal/hierarchy/selector_keys_test.go asserts the SAME file from the
|
|
// native side.
|
|
test("the web key list is the cross-runtime list", () => {
|
|
assert.deepEqual([...SELECTOR_KEYS], golden);
|
|
});
|