@@ -19,6 +19,7 @@ import {
19
19
createRemoteUserDefinedListDbItem ,
20
20
} from "../../../factories/db-item-factories" ;
21
21
import { createMockApp } from "../../../__mocks__/appMock" ;
22
+ import { createMockCommandManager } from "../../../__mocks__/commandsMock" ;
22
23
23
24
describe ( "db config store" , ( ) => {
24
25
const extensionPath = join ( __dirname , "../../../.." ) ;
@@ -136,14 +137,16 @@ describe("db config store", () => {
136
137
it ( "should set codeQLVariantAnalysisRepositories.configError to true when config has error" , async ( ) => {
137
138
const testDataStoragePathInvalid = join ( __dirname , "data" , "invalid" ) ;
138
139
140
+ const executeCommand = jest . fn ( ) ;
139
141
const app = createMockApp ( {
140
142
extensionPath,
141
143
workspaceStoragePath : testDataStoragePathInvalid ,
144
+ commands : createMockCommandManager ( { executeCommand } ) ,
142
145
} ) ;
143
146
const configStore = new DbConfigStore ( app , false ) ;
144
147
await configStore . initialize ( ) ;
145
148
146
- expect ( app . executeCommand ) . toBeCalledWith (
149
+ expect ( executeCommand ) . toBeCalledWith (
147
150
"setContext" ,
148
151
"codeQLVariantAnalysisRepositories.configError" ,
149
152
true ,
@@ -152,14 +155,16 @@ describe("db config store", () => {
152
155
} ) ;
153
156
154
157
it ( "should set codeQLVariantAnalysisRepositories.configError to false when config is valid" , async ( ) => {
158
+ const executeCommand = jest . fn ( ) ;
155
159
const app = createMockApp ( {
156
160
extensionPath,
157
161
workspaceStoragePath : testDataStoragePath ,
162
+ commands : createMockCommandManager ( { executeCommand } ) ,
158
163
} ) ;
159
164
const configStore = new DbConfigStore ( app , false ) ;
160
165
await configStore . initialize ( ) ;
161
166
162
- expect ( app . executeCommand ) . toBeCalledWith (
167
+ expect ( executeCommand ) . toBeCalledWith (
163
168
"setContext" ,
164
169
"codeQLVariantAnalysisRepositories.configError" ,
165
170
false ,
0 commit comments