WinJS.Promise#as is not what you think it is, use wrap instead - fixes #11754

This commit is contained in:
Johannes Rieken
2016-09-09 15:12:23 +02:00
parent 46c86891ec
commit f5a0ea60c8
3 changed files with 19 additions and 1 deletions

View File

@@ -232,6 +232,20 @@ suite('window namespace tests', () => {
return result;
});
test('showQuickPick, native promise - #11754', function () {
const data = new Promise<string[]>(resolve => {
resolve(['a', 'b', 'c']);
});
const source = new CancellationTokenSource();
const result = window.showQuickPick(data, undefined, source.token);
source.cancel();
return result.then(value => {
assert.equal(value, undefined);
});
});
test('editor, selection change kind', () => {
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => window.showTextDocument(doc)).then(editor => {