1
0
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:
Travis Ralston
2021-06-11 11:36:33 -06:00
parent 63fa774af7
commit 0541b7f3c5

View File

@@ -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);