@@ -19,6 +19,7 @@ import {
1919 createRemoteUserDefinedListDbItem ,
2020} from "../../../factories/db-item-factories" ;
2121import { createMockApp } from "../../../__mocks__/appMock" ;
22+ import { createMockCommandManager } from "../../../__mocks__/commandsMock" ;
2223
2324describe ( "db config store" , ( ) => {
2425 const extensionPath = join ( __dirname , "../../../.." ) ;
@@ -136,14 +137,16 @@ describe("db config store", () => {
136137 it ( "should set codeQLVariantAnalysisRepositories.configError to true when config has error" , async ( ) => {
137138 const testDataStoragePathInvalid = join ( __dirname , "data" , "invalid" ) ;
138139
140+ const executeCommand = jest . fn ( ) ;
139141 const app = createMockApp ( {
140142 extensionPath,
141143 workspaceStoragePath : testDataStoragePathInvalid ,
144+ commands : createMockCommandManager ( { executeCommand } ) ,
142145 } ) ;
143146 const configStore = new DbConfigStore ( app , false ) ;
144147 await configStore . initialize ( ) ;
145148
146- expect ( app . executeCommand ) . toBeCalledWith (
149+ expect ( executeCommand ) . toBeCalledWith (
147150 "setContext" ,
148151 "codeQLVariantAnalysisRepositories.configError" ,
149152 true ,
@@ -152,14 +155,16 @@ describe("db config store", () => {
152155 } ) ;
153156
154157 it ( "should set codeQLVariantAnalysisRepositories.configError to false when config is valid" , async ( ) => {
158+ const executeCommand = jest . fn ( ) ;
155159 const app = createMockApp ( {
156160 extensionPath,
157161 workspaceStoragePath : testDataStoragePath ,
162+ commands : createMockCommandManager ( { executeCommand } ) ,
158163 } ) ;
159164 const configStore = new DbConfigStore ( app , false ) ;
160165 await configStore . initialize ( ) ;
161166
162- expect ( app . executeCommand ) . toBeCalledWith (
167+ expect ( executeCommand ) . toBeCalledWith (
163168 "setContext" ,
164169 "codeQLVariantAnalysisRepositories.configError" ,
165170 false ,
0 commit comments