提交 a9e0905d 编写于 作者: J Joao Moreno

fixes #32652

上级 900762c5
......@@ -338,34 +338,16 @@ suite('Event utils', () => {
});
});
test('should emit when done - setTimeout', () => {
test('should emit when done - setTimeout', async () => {
let count = 0;
const event = fromPromise(TPromise.timeout(5));
const promise = TPromise.timeout(5);
const event = fromPromise(promise);
event(() => count++);
assert.equal(count, 0);
return TPromise.timeout(10).then(() => {
assert.equal(count, 1);
});
});
test('should emit when done - setTimeout (#2)', () => {
let count = 0;
const event = fromPromise(TPromise.timeout(30));
event(() => count++);
assert.equal(count, 0);
return TPromise.timeout(0).then(() => {
assert.equal(count, 0);
return TPromise.timeout(35).then(() => {
assert.equal(count, 1);
});
});
await promise;
assert.equal(count, 1);
});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册