From 6f3824431394c9ce41bfbbda0ae61313e81ae338 Mon Sep 17 00:00:00 2001 From: Grigory Date: Fri, 31 Jan 2025 15:43:42 +0500 Subject: [PATCH] remove redunant code --- src/test/suite/index.test.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/test/suite/index.test.ts b/src/test/suite/index.test.ts index 136434f..63dd883 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, Uri } from 'vscode' +import { Position, window, workspace, WorkspaceEdit } from 'vscode' import { getFixturePath, getOptionsForFixture, wait } from '../testUtils' import * as utils from 'vscode-test-utils' @@ -291,7 +291,7 @@ suite('EditorConfig extension', function () { }).saveText('foobar') assert(window.activeTextEditor, 'no active editor') - // Before saving, the selection is on line 0. This should remain unchanged. + // Before saving, the selection is on line 0. This should remain unchanged. assert.strictEqual( window.activeTextEditor.selection.start.line, 0, @@ -336,15 +336,10 @@ function withSetting( }, } async function createDoc(contents = '', name = 'test') { - const fixturePath = getFixturePath([rule, value, name]) - - try { - await workspace.fs.delete(Uri.file(fixturePath)) - } catch { - // ignore - } - - const uri = await utils.createFile(contents, fixturePath) + const uri = await utils.createFile( + contents, + getFixturePath([rule, value, name]), + ) const doc = await workspace.openTextDocument(uri) await window.showTextDocument(doc) await wait(100) // wait for EditorConfig to apply new settings