mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
filter commands that start with an underscore, make it option in the API
This commit is contained in:
42
extensions/vscode-api-tests/src/commands.test.ts
Normal file
42
extensions/vscode-api-tests/src/commands.test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import {commands} from 'vscode';
|
||||
import {join} from 'path';
|
||||
|
||||
suite("commands namespace tests", () => {
|
||||
|
||||
test('getCommands', function(done) {
|
||||
|
||||
let p1 = commands.getCommands().then(commands => {
|
||||
let hasOneWithUnderscore = false;
|
||||
for (let command of commands) {
|
||||
if (command[0] === '_') {
|
||||
hasOneWithUnderscore = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert.ok(hasOneWithUnderscore);
|
||||
}, done);
|
||||
|
||||
let p2 = commands.getCommands(true).then(commands => {
|
||||
let hasOneWithUnderscore = false;
|
||||
for (let command of commands) {
|
||||
if (command[0] === '_') {
|
||||
hasOneWithUnderscore = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert.ok(!hasOneWithUnderscore);
|
||||
}, done);
|
||||
|
||||
Promise.all([p1, p2]).then(() => {
|
||||
done();
|
||||
}, done);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user