Skip to content

Commit a8d5fd1

Browse files
fix: update ai-config schematic tests to use correct assistants parameter and adjust mcp file paths
1 parent 1320544 commit a8d5fd1

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

packages/ng-schematics/src/cli-config/index_spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ export const appConfig: ApplicationConfig = {
337337
});
338338

339339
it("should create .vscode/mcp.json with igniteui and angular-cli servers when file does not exist", async () => {
340-
await runner.runSchematic("ai-config", {}, tree);
340+
await runner.runSchematic("ai-config", { assistants: ["vscode"] }, tree);
341341

342342
expect(tree.exists(mcpFilePath)).toBeTruthy();
343343
const content = JSON.parse(tree.readContent(mcpFilePath));
@@ -349,7 +349,7 @@ export const appConfig: ApplicationConfig = {
349349
it("should add all three servers to existing .vscode/mcp.json that has no servers", async () => {
350350
tree.create(mcpFilePath, JSON.stringify({ servers: {} }));
351351

352-
await runner.runSchematic("ai-config", {}, tree);
352+
await runner.runSchematic("ai-config", { assistants: ["vscode"] }, tree);
353353

354354
const content = JSON.parse(tree.readContent(mcpFilePath));
355355
expect(content.servers["igniteui-cli"]).toEqual({ command: "npx", args: ["-y", "igniteui-cli", "mcp"] });
@@ -364,7 +364,7 @@ export const appConfig: ApplicationConfig = {
364364
}
365365
}));
366366

367-
await runner.runSchematic("ai-config", {}, tree);
367+
await runner.runSchematic("ai-config", { assistants: ["vscode"] }, tree);
368368

369369
const content = JSON.parse(tree.readContent(mcpFilePath));
370370
expect(content.servers["igniteui-cli"]).toEqual({ command: "npx", args: ["-y", "igniteui-cli", "mcp"] });
@@ -382,7 +382,7 @@ export const appConfig: ApplicationConfig = {
382382
};
383383
tree.create(mcpFilePath, JSON.stringify(existing));
384384

385-
await runner.runSchematic("ai-config", {}, tree);
385+
await runner.runSchematic("ai-config", { assistants: ["vscode"] }, tree);
386386

387387
const content = JSON.parse(tree.readContent(mcpFilePath));
388388
expect(content).toEqual(existing);
@@ -395,7 +395,7 @@ export const appConfig: ApplicationConfig = {
395395
}
396396
}));
397397

398-
await runner.runSchematic("ai-config", {}, tree);
398+
await runner.runSchematic("ai-config", { assistants: ["vscode"] }, tree);
399399

400400
const content = JSON.parse(tree.readContent(mcpFilePath));
401401
expect(content.servers["other-server"]).toEqual({ command: "node", args: ["server.js"] });
@@ -434,7 +434,7 @@ export const appConfig: ApplicationConfig = {
434434
});
435435

436436
it("should default MCP config to .vscode/mcp.json with servers key", async () => {
437-
await runner.runSchematic("ai-config", {}, tree);
437+
await runner.runSchematic("ai-config", { assistants: ["vscode"] }, tree);
438438

439439
const filePath = "/.vscode/mcp.json";
440440
expect(tree.exists(filePath)).toBeTruthy();
@@ -456,7 +456,7 @@ export const appConfig: ApplicationConfig = {
456456
});
457457

458458
it("should write to .mcp.json when assistant is claude-code", async () => {
459-
await runner.runSchematic("ai-config", { assistants: ["claude-code"] }, tree);
459+
await runner.runSchematic("ai-config", { assistants: ["general"] }, tree);
460460

461461
const filePath = "/.mcp.json";
462462
expect(tree.exists(filePath)).toBeTruthy();

packages/ng-schematics/src/ng-new/index_spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ describe("Schematics ng-new", () => {
224224

225225
describe("addAIConfig via ng-new", () => {
226226
const workingDirectory = "my-test-project";
227-
const mcpFilePath = `${workingDirectory}/.vscode/mcp.json`;
227+
const mcpFilePath = `${workingDirectory}/.mcp.json`;
228228

229229
function setupAndRun(runner: SchematicTestRunner, myTree: Tree): Promise<UnitTestTree> {
230230
spyOn(AppProjectSchematic, "default").and.returnValue((currentTree: Tree, _context: SchematicContext) => {
@@ -239,16 +239,16 @@ describe("Schematics ng-new", () => {
239239
return runner.runSchematic("ng-new", { version: "8.0.3", name: workingDirectory, skipInstall: true, skipGit: true }, myTree);
240240
}
241241

242-
it("should create .vscode/mcp.json with both servers during ng-new", async () => {
242+
it("should create .mcp.json with both servers during ng-new", async () => {
243243
const runner = new SchematicTestRunner("schematics", collectionPath);
244244
const myTree = Tree.empty();
245245

246246
const e = await setupAndRun(runner, myTree);
247247

248248
expect(e.exists(mcpFilePath)).toBeTruthy();
249249
const content = JSON.parse(e.readContent(mcpFilePath));
250-
expect(content.servers["igniteui-cli"]).toEqual({ command: "npx", args: ["-y", "igniteui-cli", "mcp"] });
251-
expect(content.servers["igniteui-theming"]).toEqual({ command: "npx", args: ["-y", "igniteui-theming", "igniteui-theming-mcp"] });
250+
expect(content.mcpServers["igniteui-cli"]).toEqual({ command: "npx", args: ["-y", "igniteui-cli", "mcp"] });
251+
expect(content.mcpServers["igniteui-theming"]).toEqual({ command: "npx", args: ["-y", "igniteui-theming", "igniteui-theming-mcp"] });
252252
});
253253
});
254254
});

0 commit comments

Comments
 (0)