Skip to content

Commit a875bd1

Browse files
committed
use a true random file name when testing that openTextDocument opens another document, fixes microsoft#100159
1 parent acc5aab commit a875bd1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ suite('vscode API - workspace', () => {
6060
}
6161
});
6262

63-
test('openTextDocument', () => {
64-
let len = vscode.workspace.textDocuments.length;
65-
return vscode.workspace.openTextDocument(join(vscode.workspace.rootPath || '', './simple.txt')).then(doc => {
66-
assert.ok(doc);
67-
assert.equal(vscode.workspace.textDocuments.length, len + 1);
68-
});
63+
test('openTextDocument', async () => {
64+
const len = vscode.workspace.textDocuments.length;
65+
const uri = await createRandomFile();
66+
const doc = await vscode.workspace.openTextDocument(uri);
67+
assert.ok(doc);
68+
assert.equal(vscode.workspace.textDocuments.length, len + 1);
6969
});
7070

7171
test('openTextDocument, illegal path', () => {

0 commit comments

Comments
 (0)