@@ -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 , / " l i s t _ p r o j e c t s " / ) ;
35- assert . match ( stdoutInsideWorkspace , / " g e t _ b e s t _ p r a c t i c e s " / ) ;
36- assert . match ( stdoutInsideWorkspace , / " s e a r c h _ d o c u m e n t a t i o n " / ) ;
35+ assert . match ( stdoutInsideWorkspace , / " l i s t _ p r o j e c t s " / ) ;
36+ assert . match ( stdoutInsideWorkspace , / " g e t _ b e s t _ p r a c t i c e s " / ) ;
37+ assert . match ( stdoutInsideWorkspace , / " s e a r c h _ d o c u m e n t a t i o n " / ) ;
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 , / " l i s t _ p r o j e c t s " / ) ;
43- assert . match ( stdoutOutsideWorkspace , / " g e t _ b e s t _ p r a c t i c e s " / ) ;
44- assert . match ( stdoutInsideWorkspace , / " s e a r c h _ d o c u m e n t a t i o n " / ) ;
45-
46- silentNpm ( 'uninstall' , '-g' , MCP_INSPECTOR_PACKAGE_NAME ) ;
43+ assert . doesNotMatch ( stdoutOutsideWorkspace , / " l i s t _ p r o j e c t s " / ) ;
44+ assert . match ( stdoutOutsideWorkspace , / " g e t _ b e s t _ p r a c t i c e s " / ) ;
45+ assert . match ( stdoutInsideWorkspace , / " s e a r c h _ d o c u m e n t a t i o n " / ) ;
46+ } finally {
47+ await silentNpm ( 'uninstall' , '-g' , MCP_INSPECTOR_PACKAGE_NAME ) ;
48+ }
4749}
0 commit comments