mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
when running integration tests, use memfs instead of fs
This commit is contained in:
@@ -5,10 +5,9 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as vscode from 'vscode';
|
||||
import { createRandomFile, deleteFile, closeAllEditors, pathEquals, rndName, disposeAll } from '../utils';
|
||||
import { createRandomFile, deleteFile, closeAllEditors, pathEquals, rndName, disposeAll, testFs } from '../utils';
|
||||
import { join, posix, basename } from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
|
||||
suite('workspace-namespace', () => {
|
||||
|
||||
@@ -131,8 +130,7 @@ suite('workspace-namespace', () => {
|
||||
assert.ok(fs.existsSync(path));
|
||||
|
||||
d0.dispose();
|
||||
|
||||
return deleteFile(vscode.Uri.file(join(vscode.workspace.rootPath || '', './newfile.txt')));
|
||||
fs.unlinkSync(join(vscode.workspace.rootPath || '', './newfile.txt'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -702,10 +700,8 @@ suite('workspace-namespace', () => {
|
||||
|
||||
test('WorkspaceEdit: edit and rename parent folder duplicates resource #42641', async function () {
|
||||
|
||||
let dir = join(os.tmpdir(), 'before-' + rndName());
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir);
|
||||
}
|
||||
let dir = vscode.Uri.parse(`${testFs.scheme}:/before-${rndName()}`);
|
||||
await testFs.createDirectory(dir);
|
||||
|
||||
let docUri = await createRandomFile('', dir);
|
||||
let docParent = docUri.with({ path: posix.dirname(docUri.path) });
|
||||
|
||||
Reference in New Issue
Block a user