Skip to content

Commit

Permalink
use counter instead of random string for test file names
Browse files Browse the repository at this point in the history
  • Loading branch information
SunsetTechuila committed Jan 30, 2025
1 parent 4eb4e36 commit f9a2e3f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/test/suite/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
let index = 0
while (true) {
yield getFixturePath([rule, value, `${test}-${index++}`])
}
}
}

0 comments on commit f9a2e3f

Please sign in to comment.