Skip to content

Commit 1ae0fb7

Browse files
committed
refactor: await silentNpm
This is causing Windows CI to fail to the `silentNpm` being terminated.
1 parent c8a103b commit 1ae0fb7

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

tests/legacy-cli/e2e/tests/mcp/registers-tools.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,21 @@ export default async function () {
2929
);
3030

3131
// Ensure 'list_projects' is registered when inside an Angular workspace
32-
const { stdout: stdoutInsideWorkspace } = await runInspector('--method', 'tools/list');
32+
try {
33+
const { stdout: stdoutInsideWorkspace } = await runInspector('--method', 'tools/list');
3334

34-
assert.match(stdoutInsideWorkspace, /"list_projects"/);
35-
assert.match(stdoutInsideWorkspace, /"get_best_practices"/);
36-
assert.match(stdoutInsideWorkspace, /"search_documentation"/);
35+
assert.match(stdoutInsideWorkspace, /"list_projects"/);
36+
assert.match(stdoutInsideWorkspace, /"get_best_practices"/);
37+
assert.match(stdoutInsideWorkspace, /"search_documentation"/);
3738

38-
chdir('..');
39+
chdir('..');
3940

40-
const { stdout: stdoutOutsideWorkspace } = await runInspector('--method', 'tools/list');
41+
const { stdout: stdoutOutsideWorkspace } = await runInspector('--method', 'tools/list');
4142

42-
assert.doesNotMatch(stdoutOutsideWorkspace, /"list_projects"/);
43-
assert.match(stdoutOutsideWorkspace, /"get_best_practices"/);
44-
assert.match(stdoutInsideWorkspace, /"search_documentation"/);
45-
46-
silentNpm('uninstall', '-g', MCP_INSPECTOR_PACKAGE_NAME);
43+
assert.doesNotMatch(stdoutOutsideWorkspace, /"list_projects"/);
44+
assert.match(stdoutOutsideWorkspace, /"get_best_practices"/);
45+
assert.match(stdoutInsideWorkspace, /"search_documentation"/);
46+
} finally {
47+
await silentNpm('uninstall', '-g', MCP_INSPECTOR_PACKAGE_NAME);
48+
}
4749
}

0 commit comments

Comments
 (0)