import { it, expect } from "bun:test"; it("setTimeout", async () => { var lastID = -1; const result = await new Promise((resolve, reject) => { var numbers = []; for (let i = 1; i < 100; i++) { const id = setTimeout(() => { numbers.push(i); if (i === 99) { resolve(numbers); } }, i); expect(id > lastID).toBe(true); lastID = id; } }); for (let j = 0; j < result.length; j++) { expect(result[j]).toBe(j + 1); } expect(result.length).toBe(99); }); it("clearTimeout", async () => { var called = false; const id = setTimeout(() => { called = true; expect(false).toBe(true); }, 1); clearTimeout(id); await new Promise((resolve, reject) => { setTimeout(() => { resolve(); }, 10); }); expect(called).toBe(false); }); ash-dump'>bun-crash-dump Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/demos (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2023-02-13fix(FormData): make String explicit, thanks @dylan-conway (#2065)Gravatar Derrick Farris 1-1/+1
2023-02-13fix(FormData): add string literal operator (#2064)Gravatar Derrick Farris 1-2/+2
2023-02-13Add pretty printer for FormDataGravatar Jarred Sumner 5-1/+101
2023-02-13Add dynamic port assigning to Bun.serve (#2062)Gravatar MichaƂ Warda 3-5/+40
2023-02-13feat(napi): add `napi_get_value_bigint_words` (#2061)Gravatar Derrick Farris 3-0/+44
* feat(napi): add `napi_get_value_bigint_words` * fix(napi): handle `napi_get_value_bigint_words` arr too small
2023-02-13Fixes https://github.com/oven-sh/bun/issues/1456Gravatar Jarred Sumner 8-1/+148