11import { beforeEach , describe , expect , it , vi } from "vitest" ;
22import type { ChannelPluginCatalogEntry } from "../../channels/plugins/catalog.js" ;
33
4- const listChannelPluginCatalogEntriesUnfiltered = vi . hoisted ( ( ) =>
4+ const listRawChannelPluginCatalogEntries = vi . hoisted ( ( ) =>
55 vi . fn ( ( _opts ?: unknown ) : ChannelPluginCatalogEntry [ ] => [ ] ) ,
66) ;
77const getChannelPluginCatalogEntry = vi . hoisted ( ( ) =>
@@ -16,8 +16,7 @@ const applyPluginAutoEnable = vi.hoisted(() =>
1616) ;
1717
1818vi . mock ( "../../channels/plugins/catalog.js" , ( ) => ( {
19- listChannelPluginCatalogEntriesUnfiltered : ( opts ?: unknown ) =>
20- listChannelPluginCatalogEntriesUnfiltered ( opts ) ,
19+ listRawChannelPluginCatalogEntries : ( opts ?: unknown ) => listRawChannelPluginCatalogEntries ( opts ) ,
2120 getChannelPluginCatalogEntry : ( id ?: unknown , opts ?: unknown ) =>
2221 getChannelPluginCatalogEntry ( id , opts ) ,
2322} ) ) ;
@@ -125,7 +124,7 @@ describe("trusted catalog helpers", () => {
125124 pluginId : "my-cool-plugin" ,
126125 origin : "workspace" ,
127126 } ) ;
128- listChannelPluginCatalogEntriesUnfiltered . mockImplementation ( ( opts ?: unknown ) =>
127+ listRawChannelPluginCatalogEntries . mockImplementation ( ( opts ?: unknown ) =>
129128 ( opts as { excludeWorkspace ?: boolean } | undefined ) ?. excludeWorkspace
130129 ? [ ]
131130 : [ workspaceOnlyEntry ] ,
@@ -146,7 +145,7 @@ describe("trusted catalog helpers", () => {
146145 pluginId : "my-cool-plugin" ,
147146 origin : "workspace" ,
148147 } ) ;
149- listChannelPluginCatalogEntriesUnfiltered . mockImplementation ( ( opts ?: unknown ) =>
148+ listRawChannelPluginCatalogEntries . mockImplementation ( ( opts ?: unknown ) =>
150149 ( opts as { excludeWorkspace ?: boolean } | undefined ) ?. excludeWorkspace
151150 ? [ ]
152151 : [ workspaceOnlyEntry ] ,
0 commit comments