mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Convert flaky API tests to unit tests (#273398)
Convert flaky API test to unit test (#253863 , #254041) I maintain my conviction that there is an unrelated run-away API test which steals focus while these tests execute which then leads to these tests failing, since the undo command is sensitive to the current focused editor.
This commit is contained in:
@@ -1179,40 +1179,6 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
});
|
||||
|
||||
test.skip('issue #110141 - TextEdit.setEndOfLine applies an edit and invalidates redo stack even when no change is made', async () => {
|
||||
const file = await createRandomFile('hello\nworld');
|
||||
|
||||
const document = await vscode.workspace.openTextDocument(file);
|
||||
await vscode.window.showTextDocument(document);
|
||||
|
||||
// apply edit
|
||||
{
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.insert(file, new vscode.Position(0, 5), '2');
|
||||
await vscode.workspace.applyEdit(we);
|
||||
}
|
||||
|
||||
// check the document
|
||||
{
|
||||
assert.strictEqual(document.getText(), 'hello2\nworld');
|
||||
assert.strictEqual(document.isDirty, true);
|
||||
}
|
||||
|
||||
// apply no-op edit
|
||||
{
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.set(file, [vscode.TextEdit.setEndOfLine(vscode.EndOfLine.LF)]);
|
||||
await vscode.workspace.applyEdit(we);
|
||||
}
|
||||
|
||||
// undo
|
||||
{
|
||||
await vscode.commands.executeCommand('undo');
|
||||
assert.strictEqual(document.getText(), 'hello\nworld');
|
||||
assert.strictEqual(document.isDirty, false);
|
||||
}
|
||||
});
|
||||
|
||||
test('SnippetString in WorkspaceEdit', async function (): Promise<any> {
|
||||
const file = await createRandomFile('hello\nworld');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user