Files
millionco__react-doctor/packages/react-doctor/tests/resolve-workspace-dead-code-owner.test.ts
Aiden Bai 48ec9a8020 fix(cli): keep large workspace scans responsive (#1549)
* fix: keep large workspace scans responsive

* fix: harden large workspace scans

* test: normalize workspace path on Windows

* fix: resolve workspace exclusions after root redirects

* fix: honor workspace scan boundaries

* fix: keep bounded workspace scans responsive

* fix: preserve dead-code reachability

* refactor: tighten workspace scan controls

* fix(cli): bound staged workspace scans

* fix: eliminate pathological large-file scans

* fix: handle incomplete and conflicted scans

* test: configure conflict merge identity

* perf: cache repeated module resolution probes

* fix(cli): show all incomplete scan warnings

* fix(core): preserve cooperative scan semantics

* perf(cli): streamline workspace scan startup

* perf(cli): harden large workspace scans

* fix(cli): keep scan progress inline

* fix(scan): correct workspace result completeness

* fix(cli): simplify live scan status

* fix(core): make scan deadlines opt-in

* fix(scan): preserve complete workspace results

* perf(scan): accelerate very large workspaces

* fix(scan): yield CPU to foreground work

* perf(scan): avoid unnecessary project indexing

* fix(cli): keep final report inline

* test(cli): stabilize terminal recording setup

* fix(core): honor scan deadline during index probe

* fix(core): skip lint after incomplete index probe

* fix(core): preserve scoped lint ownership

* fix(cli): restore project picker on cancellation
2026-08-03 04:59:45 -07:00

32 lines
952 B
TypeScript

import { describe, expect, it } from "vite-plus/test";
import { resolveWorkspaceDeadCodeOwner } from "../src/cli/utils/resolve-workspace-dead-code-owner.js";
describe("resolveWorkspaceDeadCodeOwner", () => {
it("selects an enabled workspace root", () => {
expect(
resolveWorkspaceDeadCodeOwner({
rootDirectory: "/repo",
projectDirectories: ["/repo/packages/web", "/repo"],
isRootDeadCodeEnabled: true,
}),
).toBe("/repo");
});
it("keeps per-project analysis when the root is absent or disabled", () => {
expect(
resolveWorkspaceDeadCodeOwner({
rootDirectory: "/repo",
projectDirectories: ["/repo/packages/web"],
isRootDeadCodeEnabled: true,
}),
).toBeNull();
expect(
resolveWorkspaceDeadCodeOwner({
rootDirectory: "/repo",
projectDirectories: ["/repo"],
isRootDeadCodeEnabled: false,
}),
).toBeNull();
});
});