mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 04:00:10 +00:00
test(coding-agent): update settings and extension tests
This commit is contained in:
parent
f9eb190ef9
commit
79ab767beb
2 changed files with 0 additions and 74 deletions
|
|
@ -107,51 +107,6 @@ describe("SettingsManager", () => {
|
|||
});
|
||||
|
||||
describe("packages migration", () => {
|
||||
it("should migrate npm: sources from extensions to packages", () => {
|
||||
const settingsPath = join(agentDir, "settings.json");
|
||||
writeFileSync(
|
||||
settingsPath,
|
||||
JSON.stringify({
|
||||
extensions: ["npm:pi-doom", "/local/ext.ts", "npm:shitty-extensions"],
|
||||
}),
|
||||
);
|
||||
|
||||
const manager = SettingsManager.create(projectDir, agentDir);
|
||||
|
||||
expect(manager.getPackages()).toEqual(["npm:pi-doom", "npm:shitty-extensions"]);
|
||||
expect(manager.getExtensionPaths()).toEqual(["/local/ext.ts"]);
|
||||
});
|
||||
|
||||
it("should migrate git: sources from extensions to packages", () => {
|
||||
const settingsPath = join(agentDir, "settings.json");
|
||||
writeFileSync(
|
||||
settingsPath,
|
||||
JSON.stringify({
|
||||
extensions: ["git:github.com/user/repo", "/local/ext.ts"],
|
||||
}),
|
||||
);
|
||||
|
||||
const manager = SettingsManager.create(projectDir, agentDir);
|
||||
|
||||
expect(manager.getPackages()).toEqual(["git:github.com/user/repo"]);
|
||||
expect(manager.getExtensionPaths()).toEqual(["/local/ext.ts"]);
|
||||
});
|
||||
|
||||
it("should migrate raw github URLs from extensions to packages", () => {
|
||||
const settingsPath = join(agentDir, "settings.json");
|
||||
writeFileSync(
|
||||
settingsPath,
|
||||
JSON.stringify({
|
||||
extensions: ["https://github.com/user/repo", "/local/ext.ts"],
|
||||
}),
|
||||
);
|
||||
|
||||
const manager = SettingsManager.create(projectDir, agentDir);
|
||||
|
||||
expect(manager.getPackages()).toEqual(["https://github.com/user/repo"]);
|
||||
expect(manager.getExtensionPaths()).toEqual(["/local/ext.ts"]);
|
||||
});
|
||||
|
||||
it("should keep local-only extensions in extensions array", () => {
|
||||
const settingsPath = join(agentDir, "settings.json");
|
||||
writeFileSync(
|
||||
|
|
@ -167,22 +122,6 @@ describe("SettingsManager", () => {
|
|||
expect(manager.getExtensionPaths()).toEqual(["/local/ext.ts", "./relative/ext.ts"]);
|
||||
});
|
||||
|
||||
it("should preserve existing packages when migrating", () => {
|
||||
const settingsPath = join(agentDir, "settings.json");
|
||||
writeFileSync(
|
||||
settingsPath,
|
||||
JSON.stringify({
|
||||
packages: ["npm:existing-pkg"],
|
||||
extensions: ["npm:new-pkg", "/local/ext.ts"],
|
||||
}),
|
||||
);
|
||||
|
||||
const manager = SettingsManager.create(projectDir, agentDir);
|
||||
|
||||
expect(manager.getPackages()).toEqual(["npm:existing-pkg", "npm:new-pkg"]);
|
||||
expect(manager.getExtensionPaths()).toEqual(["/local/ext.ts"]);
|
||||
});
|
||||
|
||||
it("should handle packages with filtering objects", () => {
|
||||
const settingsPath = join(agentDir, "settings.json");
|
||||
writeFileSync(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue