Skip to content

Commit 23468af

Browse files
veeceeyclaude
andcommitted
test: replace unit test with configCase for findGraphRoots determinism
Move the findGraphRoots test from a standalone unittest to a configCase under chunk-graph/deterministic-roots as requested by the reviewer. The test exercises cyclic module dependencies (A -> C -> A, A -> B -> C) to verify deterministic graph root selection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4c6f42a commit 23468af

File tree

6 files changed

+36
-66
lines changed

6 files changed

+36
-66
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { getC } from "./c";
2+
import { getB } from "./b";
3+
4+
export function getA() {
5+
return "a";
6+
}
7+
8+
export function getCombined() {
9+
return getA() + getB() + getC();
10+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { getC } from "./c";
2+
3+
export function getB() {
4+
return "b" + getC();
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { getA } from "./a";
2+
3+
export function getC() {
4+
return "c" + getA();
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { getCombined } from "./a";
2+
3+
it("should produce deterministic output with cyclic dependencies", () => {
4+
const result = getCombined();
5+
expect(result).toContain("a");
6+
expect(result).toContain("b");
7+
expect(result).toContain("c");
8+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"use strict";
2+
3+
/** @type {import("../../../../").Configuration} */
4+
module.exports = {
5+
optimization: {
6+
concatenateModules: true
7+
}
8+
};

test/findGraphRoots.unittest.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)