From f9a2e3f49177c89e11da30bd82463a0ba85b10ba Mon Sep 17 00:00:00 2001 From: Grigory Date: Fri, 31 Jan 2025 00:59:34 +0500 Subject: [PATCH] use counter instead of random string for test file names --- src/test/suite/index.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/suite/index.test.ts b/src/test/suite/index.test.ts index 2cf5567..92a2916 100644 --- a/src/test/suite/index.test.ts +++ b/src/test/suite/index.test.ts @@ -334,11 +334,17 @@ function withSetting( async function createDoc(contents = '') { const uri = await utils.createFile( contents, - getFixturePath([rule, value, Math.random().toString(36)]), + generateFixturePath().next().value, ) const doc = await workspace.openTextDocument(uri) await window.showTextDocument(doc) await wait(50) // wait for EditorConfig to apply new settings return doc } + function* generateFixturePath(): Generator { + let index = 0 + while (true) { + yield getFixturePath([rule, value, `${test}-${index++}`]) + } + } }