You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-07 23:02:56 +03:00
Remove a layer of indirection
This commit is contained in:
@@ -251,20 +251,15 @@ describe("utils", function() {
|
|||||||
it("should execute promises in chunks", async function() {
|
it("should execute promises in chunks", async function() {
|
||||||
let promiseCount = 0;
|
let promiseCount = 0;
|
||||||
|
|
||||||
function fn1() {
|
async function fn1() {
|
||||||
return (async function() {
|
|
||||||
await utils.sleep(1);
|
await utils.sleep(1);
|
||||||
expect(promiseCount).toEqual(0);
|
expect(promiseCount).toEqual(0);
|
||||||
++promiseCount;
|
++promiseCount;
|
||||||
})();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fn2() {
|
async function fn2() {
|
||||||
return new Promise(function(resolve, reject) {
|
|
||||||
expect(promiseCount).toEqual(1);
|
expect(promiseCount).toEqual(1);
|
||||||
++promiseCount;
|
++promiseCount;
|
||||||
resolve(null);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await utils.chunkPromises([fn1, fn2], 1);
|
await utils.chunkPromises([fn1, fn2], 1);
|
||||||
|
Reference in New Issue
Block a user