We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12ae0f6 commit 8ad3bcfCopy full SHA for 8ad3bcf
1 file changed
src/vs/base/test/common/async.test.ts
@@ -41,6 +41,17 @@ suite('Async', () => {
41
return result;
42
});
43
44
+ test('Cancel callback behaviour', async function () {
45
+ let withCancelCallback = new TPromise(() => { }, () => { });
46
+ let withoutCancelCallback = new TPromise(() => { });
47
+
48
+ withCancelCallback.cancel();
49
+ withoutCancelCallback.cancel();
50
51
+ await withCancelCallback.then(undefined, err => { assert.ok(isPromiseCanceledError(err)); });
52
+ await withoutCancelCallback.then(undefined, err => { assert.ok(isPromiseCanceledError(err)); });
53
+ });
54
55
// Cancelling a sync cancelable promise will fire the cancelled token.
56
// Also, every `then` callback runs in another execution frame.
57
test('CancelablePromise execution order (sync)', function () {
0 commit comments