mirror of
https://github.com/morluto/rea
synced 2026-10-25 22:08:11 -04:00
test: isolate module mocks without changing test groups
This commit is contained in:
@@ -11,12 +11,15 @@ export const SOURCE_TEST_PROJECTS = [
|
||||
name: "services",
|
||||
group: "source",
|
||||
include: ["src/application/**/*.test.ts"],
|
||||
exclude: ["src/application/EvidenceBundleFiles.test.ts"],
|
||||
},
|
||||
{
|
||||
name: "adapters",
|
||||
group: "source",
|
||||
include: [
|
||||
"src/*.test.ts",
|
||||
// This application fixture replaces a module and needs a fresh graph.
|
||||
"src/application/EvidenceBundleFiles.test.ts",
|
||||
"src/{android,apkSignature,apktool,jeb,adb,artifacts,browser,config,cutter,dotnet,electron,erlang,evm,firmware,flutter,pcap,ghidra,go,gpu,hopper,ida,inspector,javascript,main,native,process,python,reference,rust,server,sqlite,wasm,windows}/**/*.test.ts",
|
||||
],
|
||||
},
|
||||
@@ -66,6 +69,7 @@ export const BUILT_TEST_PROJECTS = [
|
||||
name: "mcp-boundary",
|
||||
group: "built",
|
||||
include: ["tests/boundary/mcp/**/*.test.ts"],
|
||||
exclude: ["tests/boundary/mcp/javascriptAnalysisCancellation.test.ts"],
|
||||
},
|
||||
{
|
||||
name: "acceptance",
|
||||
@@ -75,7 +79,10 @@ export const BUILT_TEST_PROJECTS = [
|
||||
{
|
||||
name: "process-global",
|
||||
group: "built",
|
||||
include: ["tests/process-global/**/*.test.ts"],
|
||||
include: [
|
||||
"tests/process-global/**/*.test.ts",
|
||||
"tests/boundary/mcp/javascriptAnalysisCancellation.test.ts",
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -143,6 +143,20 @@ describe("canonical test-project ownership", () => {
|
||||
});
|
||||
|
||||
describe("test module isolation", () => {
|
||||
it.each([
|
||||
["src/application/EvidenceBundleFiles.test.ts", "adapters", "source"],
|
||||
[
|
||||
"tests/boundary/mcp/javascriptAnalysisCancellation.test.ts",
|
||||
"process-global",
|
||||
"built",
|
||||
],
|
||||
])(
|
||||
"keeps %s isolated without changing its preparation group",
|
||||
(path, name, group) => {
|
||||
expect(projectForTest(path)).toMatchObject({ name, group });
|
||||
},
|
||||
);
|
||||
|
||||
it("keeps module mocks out of projects that share one module graph", async () => {
|
||||
// A mock registered after another file in the same worker loaded the
|
||||
// module never applies, so the test's outcome depends on file scheduling.
|
||||
|
||||
Reference in New Issue
Block a user