@@ -293,7 +293,7 @@ function getDebugState(vms: ICellViewModel[]): DebugState {
293293 return firstNonDesign ? firstNonDesign . runningByLine : DebugState . Design ;
294294}
295295
296- function createMiddleWare ( testMode : boolean ) : Redux . Middleware < { } , IStore > [ ] {
296+ function createMiddleWare ( testMode : boolean , postOffice : PostOffice ) : Redux . Middleware < { } , IStore > [ ] {
297297 // Create the middleware that modifies actions to queue new actions
298298 const queueableActions = createQueueableActionMiddleware ( ) ;
299299
@@ -304,8 +304,7 @@ function createMiddleWare(testMode: boolean): Redux.Middleware<{}, IStore>[] {
304304 // Create the test middle ware. It sends messages that are used for testing only
305305 // Or if testing in UI Test.
306306 // tslint:disable-next-line: no-any
307- const acquireVsCodeApi = ( window as any ) . acquireVsCodeApi as Function ;
308- const isUITest = acquireVsCodeApi && acquireVsCodeApi ( ) . handleMessage ? true : false ;
307+ const isUITest = postOffice . vscodeApi && ( postOffice . vscodeApi as any ) . handleMessage ? true : false ;
309308 const testMiddleware = testMode || isUITest ? createTestMiddleware ( ) : undefined ;
310309
311310 // Create the logger if we're not in production mode or we're forcing logging
@@ -423,7 +422,7 @@ export function createStore<M>(
423422 } ) ;
424423
425424 // Create our middleware
426- const middleware = createMiddleWare ( testMode ) . concat ( [ addMessageDirectionMiddleware ] ) ;
425+ const middleware = createMiddleWare ( testMode , postOffice ) . concat ( [ addMessageDirectionMiddleware ] ) ;
427426
428427 // Use this reducer and middle ware to create a store
429428 const store = Redux . createStore ( rootReducer , Redux . applyMiddleware ( ...middleware ) ) ;
0 commit comments