diff options
author | 2022-11-20 07:12:01 -0800 | |
---|---|---|
committer | 2022-11-20 07:12:01 -0800 | |
commit | 757d19c2f756820628d6683c31f70cd9a26d2285 (patch) | |
tree | da55fa33ab44c7e3b114cde8bba07e7e1670eecb | |
parent | a4b67ccbff11967cf4756520eb5912f767a2bbab (diff) | |
download | bun-757d19c2f756820628d6683c31f70cd9a26d2285.tar.gz bun-757d19c2f756820628d6683c31f70cd9a26d2285.tar.zst bun-757d19c2f756820628d6683c31f70cd9a26d2285.zip |
Assert count
-rw-r--r-- | test/bun.js/react-dom.test.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/bun.js/react-dom.test.tsx b/test/bun.js/react-dom.test.tsx index ae37fb494..04074acb8 100644 --- a/test/bun.js/react-dom.test.tsx +++ b/test/bun.js/react-dom.test.tsx @@ -258,6 +258,7 @@ describe("ReactDOM", () => { }); const count = 4; it(`http server, ${count} requests`, async () => { + var remain = count; await (async function () { var server; try { @@ -269,10 +270,9 @@ describe("ReactDOM", () => { ); }, }); - var total = 0; gc(); - while (total++ < count) { - var attempt = total; + while (remain--) { + var attempt = remain + 1; const response = await fetch( "http://localhost:" + server.port + "/", ); @@ -293,10 +293,11 @@ describe("ReactDOM", () => { server.stop(); } })(); - expect( - heapStats().objectTypeCounts.ReadableHTTPResponseSinkController ?? - 0, - ).toBe(1); + + const { ReadableHTTPResponseSinkController = 0 } = + heapStats().objectTypeCounts; + expect(ReadableHTTPResponseSinkController).toBe(1); + expect(remain + 1).toBe(0); }); }); } |