mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-21 13:36:49 +01:00
Add tests from #52412
This commit is contained in:
@@ -5,13 +5,13 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as WinJS from 'vs/base/common/winjs.base';
|
||||
import * as winjs from 'vs/base/common/winjs.base';
|
||||
|
||||
suite('WinJS and ES6 Promises', function () {
|
||||
|
||||
test('Promise.resolve', function () {
|
||||
let resolveTPromise;
|
||||
const tPromise = new WinJS.Promise(function (c, e, p) {
|
||||
const tPromise = new winjs.Promise(function (c, e, p) {
|
||||
resolveTPromise = c;
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ suite('WinJS and ES6 Promises', function () {
|
||||
|
||||
test('new Promise', function () {
|
||||
let resolveTPromise;
|
||||
const tPromise = new WinJS.Promise(function (c, e, p) {
|
||||
const tPromise = new winjs.Promise(function (c, e, p) {
|
||||
resolveTPromise = c;
|
||||
});
|
||||
|
||||
@@ -44,4 +44,27 @@ suite('WinJS and ES6 Promises', function () {
|
||||
|
||||
return done;
|
||||
});
|
||||
|
||||
test('1. Uncaught TypeError: this._state.then is not a function', () => {
|
||||
let p1 = winjs.Promise.wrap<number>(new Promise<number>(function (c, e) { c(1); }));
|
||||
Promise.all([p1]);
|
||||
});
|
||||
|
||||
test('2. Uncaught TypeError: this._state.then is not a function', () => {
|
||||
let p1 = winjs.Promise.wrap<number>(new Promise<number>(function (c, e) { c(1); }));
|
||||
let thenFunc = p1.then.bind(p1);
|
||||
setTimeout(() => {
|
||||
thenFunc(() => { });
|
||||
}, 0);
|
||||
});
|
||||
|
||||
test('3. Uncaught TypeError: this._state.then is not a function', () => {
|
||||
let c;
|
||||
let p1 = new winjs.Promise(function (_c, e) { c = _c; });
|
||||
let thenFunc = p1.then.bind(p1);
|
||||
setTimeout(() => {
|
||||
c(1);
|
||||
thenFunc(() => { });
|
||||
}, 0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user