Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/features/rules/copilot-rule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,15 @@ describe("CopilotRule", () => {
rulesyncRule: original,
});

// Root Copilot file must have no applyTo when the rulesync rule had no globs.
expect(copilotRule.getFrontmatter().applyTo).toBeUndefined();
// Root Copilot file must have no frontmatter.
expect(copilotRule.getFrontmatter()).toEqual({});

const reimported = copilotRule.toRulesyncRule();
const rf = reimported.getFrontmatter();

expect(rf.root).toBe(true);
expect(rf.globs).toBeUndefined();
expect(rf.description).toBe("Project overview");
expect(rf.description).toBeUndefined();
expect(reimported.getBody()).toBe("Overview content");
});

Expand Down Expand Up @@ -407,10 +407,7 @@ describe("CopilotRule", () => {
validate: true,
});

expect(copilotRule.getFrontmatter()).toEqual({
description: "Root rule from rulesync",
applyTo: "**/*",
});
expect(copilotRule.getFrontmatter()).toEqual({});
expect(copilotRule.getBody()).toBe("Root rulesync rule content");
expect(copilotRule.getRelativeDirPath()).toBe(".github");
expect(copilotRule.getRelativeFilePath()).toBe("copilot-instructions.md");
Expand Down Expand Up @@ -494,7 +491,7 @@ describe("CopilotRule", () => {
validate: true,
});

expect(copilotRule.getFrontmatter().excludeAgent).toBe("coding-agent");
expect(copilotRule.getFrontmatter()).toEqual({});
});

it("should use default baseDir when not provided", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/features/rules/copilot-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class CopilotRule extends ToolRule {
// Root file: .github/copilot-instructions.md (no frontmatter for root file)
return new CopilotRule({
baseDir: baseDir,
frontmatter: copilotFrontmatter,
frontmatter: {},
body,
relativeDirPath: paths.root.relativeDirPath,
relativeFilePath: paths.root.relativeFilePath,
Expand Down
Loading