From 3a0d693210c1bfc0f9a9dbb09643f74c49ec77bc Mon Sep 17 00:00:00 2001 From: Grigory Date: Fri, 31 Jan 2025 02:41:42 +0500 Subject: [PATCH] god i hate vscode --- src/test/suite/index.test.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/test/suite/index.test.ts b/src/test/suite/index.test.ts index 46389a9..a485035 100644 --- a/src/test/suite/index.test.ts +++ b/src/test/suite/index.test.ts @@ -1,6 +1,6 @@ import * as assert from 'assert' import * as os from 'os' -import { Position, window, workspace, WorkspaceEdit } from 'vscode' +import { Position, window, workspace, WorkspaceEdit, Uri } from 'vscode' import { getFixturePath, getOptionsForFixture, wait } from '../testUtils' import * as utils from 'vscode-test-utils' @@ -335,10 +335,15 @@ function withSetting( }, } async function createDoc(contents = '', name = 'test') { - const uri = await utils.createFile( - contents, - getFixturePath([rule, value, name]), - ) + const fixturePath = getFixturePath([rule, value, name]) + + try { + await workspace.fs.delete(Uri.file(fixturePath)) + } catch { + // ignore + } + + const uri = await utils.createFile(contents, fixturePath) const doc = await workspace.openTextDocument(uri) await window.showTextDocument(doc) await wait(50) // wait for EditorConfig to apply new settings