Skip to content

Commit

Permalink
fix #106283
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Sep 9, 2020
1 parent bb27a30 commit 1d177e2
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as assert from 'assert';
import * as os from 'os';
import * as path from 'vs/base/common/path';
import * as uuid from 'vs/base/common/uuid';
import * as pfs from 'vs/base/node/pfs';
import { IFileService, FileChangeType, IFileChange, IFileSystemProviderWithFileReadWriteCapability, IStat, FileType, FileSystemProviderCapabilities } from 'vs/platform/files/common/files';
import { FileService } from 'vs/platform/files/common/fileService';
import { NullLogService } from 'vs/platform/log/common/log';
Expand All @@ -31,6 +30,7 @@ suite('FileUserDataProvider', () => {
let backupWorkspaceHomeOnDisk: URI;
let environmentService: IWorkbenchEnvironmentService;
const disposables = new DisposableStore();
let fileUserDataProvider: FileUserDataProvider;

setup(async () => {
const logService = new NullLogService();
Expand All @@ -50,14 +50,15 @@ suite('FileUserDataProvider', () => {
backupWorkspaceHomeOnDisk = joinPath(backupHome, workspaceId);
await Promise.all([testObject.createFolder(userDataHomeOnDisk), testObject.createFolder(backupWorkspaceHomeOnDisk)]);

const userDataFileSystemProvider = new FileUserDataProvider(userDataHomeOnDisk, backupWorkspaceHomeOnDisk, diskFileSystemProvider, environmentService, logService);
disposables.add(userDataFileSystemProvider);
disposables.add(testObject.registerProvider(Schemas.userData, userDataFileSystemProvider));
fileUserDataProvider = new FileUserDataProvider(userDataHomeOnDisk, backupWorkspaceHomeOnDisk, diskFileSystemProvider, environmentService, logService);
disposables.add(fileUserDataProvider);
disposables.add(testObject.registerProvider(Schemas.userData, fileUserDataProvider));
});

teardown(async () => {
fileUserDataProvider.dispose(); // need to dispose first, otherwise del will fail (https://github.com/microsoft/vscode/issues/106283)
await testObject.del(rootResource, { recursive: true });
disposables.clear();
await pfs.rimraf(rootResource.fsPath, pfs.RimRafMode.MOVE);
});

test('exists return false when file does not exist', async () => {
Expand Down

0 comments on commit 1d177e2

Please sign in to comment.