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:
Alexandru Dima
2025-10-26 15:11:46 +01:00
committed by GitHub
parent 547c05a522
commit 65b22997d7
3 changed files with 147 additions and 93 deletions

View File

@@ -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');