From 78cbcc5cc05257da476091782a36afeb3d276e29 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Wed, 8 Apr 2020 15:41:54 -0700 Subject: [PATCH] Fix tests --- .../contrib/search/test/browser/queryBuilder.test.ts | 2 +- .../search/test/electron-browser/queryBuilder.test.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/search/test/browser/queryBuilder.test.ts b/src/vs/workbench/contrib/search/test/browser/queryBuilder.test.ts index 48881d83ad6..cc8f788f891 100644 --- a/src/vs/workbench/contrib/search/test/browser/queryBuilder.test.ts +++ b/src/vs/workbench/contrib/search/test/browser/queryBuilder.test.ts @@ -50,7 +50,7 @@ suite('QueryBuilder', () => { instantiationService.stub(IWorkspaceContextService, mockContextService); instantiationService.stub(IEnvironmentService, TestEnvironmentService); - instantiationService.stub(IRemotePathService, TestRemotePathService); + instantiationService.stub(IRemotePathService, new TestRemotePathService(TestEnvironmentService)); queryBuilder = instantiationService.createInstance(QueryBuilder); }); diff --git a/src/vs/workbench/contrib/search/test/electron-browser/queryBuilder.test.ts b/src/vs/workbench/contrib/search/test/electron-browser/queryBuilder.test.ts index 2adb24ef715..bc60138cbbc 100644 --- a/src/vs/workbench/contrib/search/test/electron-browser/queryBuilder.test.ts +++ b/src/vs/workbench/contrib/search/test/electron-browser/queryBuilder.test.ts @@ -11,6 +11,8 @@ import { ISearchPathsInfo, QueryBuilder } from 'vs/workbench/contrib/search/comm import { TestEnvironmentService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { assertEqualSearchPathResults, getUri, patternsToIExpression, globalGlob, fixPath } from 'vs/workbench/contrib/search/test/browser/queryBuilder.test'; import { TestContextService } from 'vs/workbench/test/common/workbenchTestServices'; +import { TestRemotePathService } from 'vs/workbench/test/browser/workbenchTestServices'; +import { IRemotePathService } from 'vs/workbench/services/path/common/remotePathService'; const DEFAULT_EDITOR_CONFIG = {}; const DEFAULT_USER_CONFIG = { useRipgrep: true, useIgnoreFiles: true, useGlobalIgnoreFiles: true }; @@ -25,7 +27,7 @@ suite('QueryBuilder', () => { let mockContextService: TestContextService; let mockWorkspace: Workspace; - setup(() => { + setup(async () => { instantiationService = new TestInstantiationService(); mockConfigService = new TestConfigurationService(); @@ -39,8 +41,10 @@ suite('QueryBuilder', () => { instantiationService.stub(IWorkspaceContextService, mockContextService); instantiationService.stub(IEnvironmentService, TestEnvironmentService); + instantiationService.stub(IRemotePathService, new TestRemotePathService(TestEnvironmentService)); queryBuilder = instantiationService.createInstance(QueryBuilder); + await new Promise(resolve => setTimeout(resolve, 5)); // Wait for RemotePathService.userHome to resolve }); suite('parseSearchPaths', () => {