Skip to content

Commit 37c4cea

Browse files
committed
🐛 Sort the arrays map just made so the Node typecheck accepts them
`toSorted()` is ES2023 and the Node typecheck targets ES2022, so two rows of the `<All>` suite failed every `test-node` shard while Deno and Bun passed. `sort()` on the array `map` just made is the convention this repository already documents in `scripts/lib/verify.ts` and Git's remote-composition proof.
1 parent 1ab1b96 commit 37c4cea

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/core/tests/all.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,10 @@ describe("Tier ALL — PA3: counters, paths and the parent's own numbering", ()
583583
expect(onParent.map((entry) => entry.name)).toEqual(["eval:eval:root:0", "eval:eval:root:1"]);
584584

585585
const inChildren = entries.filter((entry) => entry.coroutineId !== "root");
586-
expect(inChildren.map((entry) => entry.coroutineId).toSorted()).toEqual(["root.0", "root.1"]);
586+
// `sort()` rather than `toSorted()`: the Node typecheck targets ES2022, where
587+
// the latter does not exist, and the array being sorted is the one `map` just
588+
// made — so there is nothing of anyone else's to mutate.
589+
expect(inChildren.map((entry) => entry.coroutineId).sort()).toEqual(["root.0", "root.1"]);
587590
// Both children number their own first block the same way and collide with
588591
// nothing, because the child coroutine namespaces it.
589592
expect(new Set(inChildren.map((entry) => entry.name))).toEqual(new Set(["eval:eval:root:0"]));
@@ -605,8 +608,9 @@ describe("Tier ALL — PA3: counters, paths and the parent's own numbering", ()
605608
// which child appends first is exactly what scheduling is allowed to
606609
// decide — the contract fixes what a block is called and where, never the
607610
// order two independent children reach the journal.
611+
// `sort()` for the same reason, on the array `map` just made.
608612
const identify = (found: EvalEntry[]): string[] =>
609-
found.map((entry) => `${entry.coroutineId}/${entry.name}`).toSorted();
613+
found.map((entry) => `${entry.coroutineId}/${entry.name}`).sort();
610614
expect(identify(evalEntries(rerun.events))).toEqual(identify(entries));
611615

612616
// And a replay reproduces the rendering without running any of it.

0 commit comments

Comments
 (0)