@@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
22
33const loadBundledPluginPublicSurfaceModuleSync = vi . hoisted ( ( ) => vi . fn ( ) ) ;
44const registerQaLabCliImpl = vi . hoisted ( ( ) => vi . fn ( ) ) ;
5+ const isQaLabCliAvailableImpl = vi . hoisted ( ( ) => vi . fn ( ) ) ;
56
67vi . mock ( "./facade-loader.js" , async ( ) => {
78 const actual = await vi . importActual < typeof import ( "./facade-loader.js" ) > ( "./facade-loader.js" ) ;
@@ -14,7 +15,9 @@ vi.mock("./facade-loader.js", async () => {
1415describe ( "plugin-sdk qa-lab" , ( ) => {
1516 beforeEach ( ( ) => {
1617 registerQaLabCliImpl . mockReset ( ) ;
18+ isQaLabCliAvailableImpl . mockReset ( ) . mockReturnValue ( true ) ;
1719 loadBundledPluginPublicSurfaceModuleSync . mockReset ( ) . mockReturnValue ( {
20+ isQaLabCliAvailable : isQaLabCliAvailableImpl ,
1821 registerQaLabCli : registerQaLabCliImpl ,
1922 } ) ;
2023 } ) ;
@@ -36,4 +39,13 @@ describe("plugin-sdk qa-lab", () => {
3639 module . registerQaLabCli ( { } as never ) ;
3740 expect ( registerQaLabCliImpl ) . toHaveBeenCalledWith ( { } as never ) ;
3841 } ) ;
42+
43+ it ( "reports qa-lab unavailable when private facade artifacts are not packed" , async ( ) => {
44+ loadBundledPluginPublicSurfaceModuleSync . mockImplementation ( ( ) => {
45+ throw new Error ( "Unable to resolve bundled plugin public surface qa-lab/cli.js" ) ;
46+ } ) ;
47+ const module = await import ( "./qa-lab.js" ) ;
48+
49+ expect ( module . isQaLabCliAvailable ( ) ) . toBe ( false ) ;
50+ } ) ;
3951} ) ;
0 commit comments