mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
add 'vscode.open' API command, fixes #566
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
import {join} from 'path';
|
||||
import {commands, workspace, window, Uri} from 'vscode';
|
||||
import {commands, workspace, window, Uri, ViewColumn} from 'vscode';
|
||||
|
||||
suite('commands namespace tests', () => {
|
||||
|
||||
@@ -103,4 +103,14 @@ suite('commands namespace tests', () => {
|
||||
|
||||
return Promise.all([a, b, c, d]);
|
||||
});
|
||||
|
||||
test('api-command: vscode.open', function () {
|
||||
let uri = Uri.file(join(workspace.rootPath, './image.png'));
|
||||
let a = commands.executeCommand('vscode.open', uri).then(() => assert.ok(true), () => assert.ok(false));
|
||||
let b = commands.executeCommand('vscode.open', uri, ViewColumn.Two).then(() => assert.ok(true), () => assert.ok(false));
|
||||
let c = commands.executeCommand('vscode.open').then(() => assert.ok(false), () => assert.ok(true));
|
||||
let d = commands.executeCommand('vscode.open', uri, true).then(() => assert.ok(false), () => assert.ok(true));
|
||||
|
||||
return Promise.all([a, b, c, d]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user