test(FN-5006): complete Step 2 — add changeset-only scope overlap regressions
Fusion-Task-Id: FN-5006 Fusion-Task-Lineage: 30b6651f-8b0b-4918-aec9-77c4cb59cb85
This commit is contained in:
committed by
gsxdsm
parent
e9a1c103ea
commit
07fe2cd91d
@@ -151,6 +151,30 @@ describe("assertSquashOverlapsFileScope", () => {
|
||||
} satisfies Partial<FileScopeViolationError>);
|
||||
});
|
||||
|
||||
it("accepts declared scope as a single changeset file when staged matches exactly", async () => {
|
||||
const store = createInvariantStore([".changeset/fn-4767-pr-flow.md"]);
|
||||
mockStagedFiles([".changeset/fn-4767-pr-flow.md"]);
|
||||
|
||||
await expect(assertSquashOverlapsFileScope({
|
||||
store: store as never,
|
||||
taskId: "FN-4073",
|
||||
rootDir: "/tmp/root",
|
||||
task: await (store as any).getTask("FN-4073"),
|
||||
})).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
it("accepts declared scope as a changeset glob when staged file matches", async () => {
|
||||
const store = createInvariantStore([".changeset/*.md"]);
|
||||
mockStagedFiles([".changeset/fn-4767-pr-flow.md"]);
|
||||
|
||||
await expect(assertSquashOverlapsFileScope({
|
||||
store: store as never,
|
||||
taskId: "FN-4073",
|
||||
rootDir: "/tmp/root",
|
||||
task: await (store as any).getTask("FN-4073"),
|
||||
})).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
it("bypasses enforcement and logs once when scopeOverride is true", async () => {
|
||||
const store = createInvariantStore(["packages/engine/src/merger.ts"], { scopeOverride: true });
|
||||
mockStagedFiles(["packages/core/src/store.ts"]);
|
||||
|
||||
Reference in New Issue
Block a user