add 'vscode.open' API command, fixes #566

This commit is contained in:
Johannes Rieken
2016-06-27 15:33:08 +02:00
parent 5ed2332c0b
commit a941b59fe9
4 changed files with 37 additions and 1 deletions

View File

@@ -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]);
});
});