@@ -29,19 +29,21 @@ export default async function () {
29
29
) ;
30
30
31
31
// 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' ) ;
33
34
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 " / ) ;
37
38
38
- chdir ( '..' ) ;
39
+ chdir ( '..' ) ;
39
40
40
- const { stdout : stdoutOutsideWorkspace } = await runInspector ( '--method' , 'tools/list' ) ;
41
+ const { stdout : stdoutOutsideWorkspace } = await runInspector ( '--method' , 'tools/list' ) ;
41
42
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
+ }
47
49
}
0 commit comments