fix(FN-XXXX): avoid inheriting unregistered parent projects

This commit is contained in:
gsxdsm
2026-05-01 23:35:44 -07:00
parent 0597b34eea
commit 2607c55637
3 changed files with 28 additions and 9 deletions

View File

@@ -118,6 +118,16 @@ describe("project-context", () => {
expect(found?.name).toBe("legacy-project");
});
it("should not inherit an unregistered parent project from a nested cwd", async () => {
const projectPath = createMockProject("legacy-project");
const nestedDir = join(projectPath, "src", "components");
mkdirSync(nestedDir, { recursive: true });
const found = await detectProjectFromCwd(nestedDir, central);
expect(found).toBeUndefined();
});
it("should ignore invalid fusion.db files in the cwd", async () => {
const projectPath = join(tempDir, "invalid-project");
mkdirSync(join(projectPath, ".fusion"), { recursive: true });