@@ -507,13 +507,22 @@ describe("discoverOpenClawPlugins", () => {
507507 const workspaceDir = path . join ( stateDir , "workspace" ) ;
508508 const globalExt = path . join ( stateDir , "extensions" ) ;
509509 mkdirSafe ( globalExt ) ;
510- fs . writeFileSync ( path . join ( globalExt , "types.d.ts" ) , "export type Foo = string;" , "utf-8" ) ;
511- fs . writeFileSync ( path . join ( globalExt , "types.d.mts" ) , "export type Bar = number;" , "utf-8" ) ;
512- fs . writeFileSync ( path . join ( globalExt , "types.d.cts" ) , "export type Baz = boolean;" , "utf-8" ) ;
513510
514- const { candidates, diagnostics } = await discoverWithStateDir ( stateDir , { workspaceDir } ) ;
511+ fs . writeFileSync ( path . join ( globalExt , "alpha.d.ts" ) , "export type Foo = string;" , "utf-8" ) ;
512+ fs . writeFileSync ( path . join ( globalExt , "bravo.d.mts" ) , "export type Bar = number;" , "utf-8" ) ;
513+ fs . writeFileSync ( path . join ( globalExt , "charlie.d.cts" ) , "export type Baz = boolean;" , "utf-8" ) ;
514+ fs . writeFileSync ( path . join ( globalExt , "delta.mts" ) , "export default {};" , "utf-8" ) ;
515+ fs . writeFileSync ( path . join ( globalExt , "echo.cts" ) , "export default {};" , "utf-8" ) ;
516+
517+ const { candidates, diagnostics } = await discoverWithStateDir ( stateDir , {
518+ workspaceDir,
519+ extraPaths : [ globalExt ] ,
520+ } ) ;
515521
516- expectCandidateIds ( candidates , { excludes : [ "types" ] } ) ;
522+ expectCandidateIds ( candidates , {
523+ includes : [ "delta" , "echo" ] ,
524+ excludes : [ "alpha.d" , "bravo.d" , "charlie.d" ] ,
525+ } ) ;
517526 expect ( diagnostics ) . toStrictEqual ( [ ] ) ;
518527 } ) ;
519528
0 commit comments