chore: replace console.log with array and assertEquals (#2261)

This commit is contained in:
Tim Reichen 2022-05-22 16:18:10 +02:00 committed by GitHub
parent 11b2b7f7f7
commit 6dcb19b003
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,9 +15,11 @@ Deno.test("[async] pooledMap", async function () {
[1, 2, 3],
(i) => new Promise((r) => setTimeout(() => r(i), 1000)),
);
const array = [];
for await (const value of results) {
console.log(value);
array.push(value);
}
assertEquals(array, [1, 2, 3]);
const diff = new Date().getTime() - start.getTime();
assert(diff >= 2000);
assert(diff < 3000);