Skip to content

Commit 67e628e

Browse files
authored
The quest to debug vscode.open continues (microsoft#158483)
1 parent 99dd406 commit 67e628e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,22 @@ suite('vscode API - commands', () => {
111111
});
112112

113113
test('api-command: vscode.open', async function () {
114-
const uri = Uri.parse(workspace.workspaceFolders![0].uri.toString() + '/far.js');
114+
assert.ok(workspace.workspaceFolders);
115+
assert.ok(workspace.workspaceFolders.length > 0);
116+
const uri = Uri.parse(workspace.workspaceFolders[0].uri.toString() + '/far.js');
115117

116118
await commands.executeCommand('vscode.open', uri);
119+
assert.strictEqual(window.tabGroups.all.length, 1);
117120
assert.strictEqual(window.tabGroups.all[0].activeTab?.group.viewColumn, ViewColumn.One);
118121
assert.strictEqual(window.activeTextEditor?.viewColumn, ViewColumn.One);
119122

120123
await commands.executeCommand('vscode.open', uri, ViewColumn.Two);
124+
assert.strictEqual(window.tabGroups.all.length, 2);
121125
assert.strictEqual(window.tabGroups.all[1].activeTab?.group.viewColumn, ViewColumn.Two);
122126
assert.strictEqual(window.activeTextEditor?.viewColumn, ViewColumn.Two);
123127

124128
await commands.executeCommand('vscode.open', uri, ViewColumn.One);
129+
assert.strictEqual(window.tabGroups.all.length, 2);
125130
assert.strictEqual(window.tabGroups.all[0].activeTab?.group.viewColumn, ViewColumn.One);
126131
assert.strictEqual(window.activeTextEditor?.viewColumn, ViewColumn.One);
127132

0 commit comments

Comments
 (0)