mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
tests - reduce output of integration tests (#84283)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as vscode from 'vscode';
|
||||
import { createRandomFile, deleteFile, closeAllEditors, pathEquals, rndName, disposeAll, testFs, delay } from '../utils';
|
||||
import { createRandomFile, deleteFile, closeAllEditors, pathEquals, rndName, disposeAll, testFs, delay, withLogDisabled } from '../utils';
|
||||
import { join, posix, basename } from 'path';
|
||||
import * as fs from 'fs';
|
||||
|
||||
@@ -598,7 +598,7 @@ suite('workspace-namespace', () => {
|
||||
assert.equal(doc.isDirty, true);
|
||||
});
|
||||
|
||||
test('applyEdit should fail when editing deleted resource', async () => {
|
||||
test('applyEdit should fail when editing deleted resource', withLogDisabled(async () => {
|
||||
const resource = await createRandomFile();
|
||||
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
@@ -607,9 +607,9 @@ suite('workspace-namespace', () => {
|
||||
|
||||
let success = await vscode.workspace.applyEdit(edit);
|
||||
assert.equal(success, false);
|
||||
});
|
||||
}));
|
||||
|
||||
test('applyEdit should fail when renaming deleted resource', async () => {
|
||||
test('applyEdit should fail when renaming deleted resource', withLogDisabled(async () => {
|
||||
const resource = await createRandomFile();
|
||||
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
@@ -618,9 +618,9 @@ suite('workspace-namespace', () => {
|
||||
|
||||
let success = await vscode.workspace.applyEdit(edit);
|
||||
assert.equal(success, false);
|
||||
});
|
||||
}));
|
||||
|
||||
test('applyEdit should fail when editing renamed from resource', async () => {
|
||||
test('applyEdit should fail when editing renamed from resource', withLogDisabled(async () => {
|
||||
const resource = await createRandomFile();
|
||||
const newResource = vscode.Uri.file(resource.fsPath + '.1');
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
@@ -629,7 +629,7 @@ suite('workspace-namespace', () => {
|
||||
|
||||
let success = await vscode.workspace.applyEdit(edit);
|
||||
assert.equal(success, false);
|
||||
});
|
||||
}));
|
||||
|
||||
test('applyEdit "edit A -> rename A to B -> edit B"', async () => {
|
||||
await testEditRenameEdit(oldUri => oldUri.with({ path: oldUri.path + 'NEW' }));
|
||||
@@ -662,7 +662,7 @@ suite('workspace-namespace', () => {
|
||||
return uri.with({ path: posix.join(posix.dirname(uri.path), `_${posix.basename(uri.path)}`) });
|
||||
}
|
||||
|
||||
test('WorkspaceEdit: applying edits before and after rename duplicates resource #42633', async function () {
|
||||
test('WorkspaceEdit: applying edits before and after rename duplicates resource #42633', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile();
|
||||
let newUri = nameWithUnderscore(docUri);
|
||||
|
||||
@@ -675,9 +675,9 @@ suite('workspace-namespace', () => {
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
let doc = await vscode.workspace.openTextDocument(newUri);
|
||||
assert.equal(doc.getText(), 'BarHelloFoo');
|
||||
});
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: Problem recreating a renamed resource #42634', async function () {
|
||||
test('WorkspaceEdit: Problem recreating a renamed resource #42634', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile();
|
||||
let newUri = nameWithUnderscore(docUri);
|
||||
|
||||
@@ -695,9 +695,9 @@ suite('workspace-namespace', () => {
|
||||
assert.equal(newDoc.getText(), 'HelloFoo');
|
||||
let doc = await vscode.workspace.openTextDocument(docUri);
|
||||
assert.equal(doc.getText(), 'Bar');
|
||||
});
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit api - after saving a deleted file, it still shows up as deleted. #42667', async function () {
|
||||
test('WorkspaceEdit api - after saving a deleted file, it still shows up as deleted. #42667', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile();
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
we.deleteFile(docUri);
|
||||
@@ -710,7 +710,7 @@ suite('workspace-namespace', () => {
|
||||
} catch (e) {
|
||||
assert.ok(true);
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: edit and rename parent folder duplicates resource #42641', async function () {
|
||||
|
||||
@@ -741,7 +741,7 @@ suite('workspace-namespace', () => {
|
||||
assert.equal(doc.getText(), 'Hello');
|
||||
});
|
||||
|
||||
test('WorkspaceEdit: rename resource followed by edit does not work #42638', async function () {
|
||||
test('WorkspaceEdit: rename resource followed by edit does not work #42638', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile();
|
||||
let newUri = nameWithUnderscore(docUri);
|
||||
|
||||
@@ -753,9 +753,9 @@ suite('workspace-namespace', () => {
|
||||
|
||||
let doc = await vscode.workspace.openTextDocument(newUri);
|
||||
assert.equal(doc.getText(), 'Hello');
|
||||
});
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: create & override', async function () {
|
||||
test('WorkspaceEdit: create & override', withLogDisabled(async function () {
|
||||
|
||||
let docUri = await createRandomFile('before');
|
||||
|
||||
@@ -768,9 +768,9 @@ suite('workspace-namespace', () => {
|
||||
we.createFile(docUri, { overwrite: true });
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
assert.equal((await vscode.workspace.openTextDocument(docUri)).getText(), '');
|
||||
});
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: create & ignoreIfExists', async function () {
|
||||
test('WorkspaceEdit: create & ignoreIfExists', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile('before');
|
||||
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
@@ -782,9 +782,9 @@ suite('workspace-namespace', () => {
|
||||
we.createFile(docUri, { overwrite: true, ignoreIfExists: true });
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
assert.equal((await vscode.workspace.openTextDocument(docUri)).getText(), '');
|
||||
});
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: rename & ignoreIfExists', async function () {
|
||||
test('WorkspaceEdit: rename & ignoreIfExists', withLogDisabled(async function () {
|
||||
let aUri = await createRandomFile('aaa');
|
||||
let bUri = await createRandomFile('bbb');
|
||||
|
||||
@@ -803,9 +803,9 @@ suite('workspace-namespace', () => {
|
||||
we = new vscode.WorkspaceEdit();
|
||||
we.renameFile(aUri, bUri, { overwrite: true, ignoreIfExists: true });
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
});
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: delete & ignoreIfNotExists', async function () {
|
||||
test('WorkspaceEdit: delete & ignoreIfNotExists', withLogDisabled(async function () {
|
||||
|
||||
let docUri = await createRandomFile();
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
@@ -819,7 +819,7 @@ suite('workspace-namespace', () => {
|
||||
we = new vscode.WorkspaceEdit();
|
||||
we.deleteFile(docUri, { ignoreIfNotExists: true });
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
});
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: insert & rename multiple', async function () {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user