integration tests - use async test (#120225)

This commit is contained in:
Benjamin Pasero
2021-04-06 10:34:08 +02:00
parent 6f8b983dfd
commit 8de3791477
3 changed files with 24 additions and 31 deletions

View File

@@ -13,33 +13,26 @@ suite('vscode API - commands', () => {
teardown(assertNoRpc);
test('getCommands', function (done) {
test('getCommands', async function () {
let p1 = commands.getCommands().then(commands => {
let hasOneWithUnderscore = false;
for (let command of commands) {
if (command[0] === '_') {
hasOneWithUnderscore = true;
break;
}
let cmds = await commands.getCommands();
let hasOneWithUnderscore = false;
for (let command of cmds) {
if (command[0] === '_') {
hasOneWithUnderscore = true;
break;
}
assert.ok(hasOneWithUnderscore);
}, done);
}
assert.ok(hasOneWithUnderscore);
let p2 = commands.getCommands(true).then(commands => {
let hasOneWithUnderscore = false;
for (let command of commands) {
if (command[0] === '_') {
hasOneWithUnderscore = true;
break;
}
cmds = await commands.getCommands(true);
for (let command of cmds) {
if (command[0] === '_') {
hasOneWithUnderscore = true;
break;
}
assert.ok(!hasOneWithUnderscore);
}, done);
Promise.all([p1, p2]).then(() => {
done();
}, done);
}
assert.ok(!hasOneWithUnderscore);
});
test('command with args', async function () {