aboutsummaryrefslogtreecommitdiff
path: root/test/js/web (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-08-31get name if not provided in `FormData.append` (#4434)Gravatar Dylan Conway 1-0/+30
* get file name from blob if not provided * add test * another test * format
2023-08-23Bunch of streams fixes (#4251)Gravatar Jarred Sumner 1-14/+17
* Update WebKit * Don't do async hooks things when async hooks are not enabled * Smarter scheduling of event loop tasks with the http server * less exciting approach * Bump WebKit * Another approach * Fix body-stream tests * Fixes #1886 * Fix UAF in fetch body streaming * Missing from commit * Fix leak * Fix the other leak * Fix test * Fix crash * missing duperef * Make this code clearer * Ignore empty chunks * Fixes #3969 * Delete flaky test * Update bun-linux-build.yml * Fix memory issue * fix result body, and .done status before the last callback, dont touch headers after sent once * refactor HTTPClientResult * less flasky corrupted test * oops * fix mutex invalid state * fix onProgressUpdate deinit/unlock * fix onProgressUpdate deinit/unlock * oops * remove verbose * fix posible null use * avoid http null * metadata can still be used onReject after toResponse * dont leak task.http * fix flask tests * less flask close tests --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2023-08-21fetch(stream) add stream support for compressed and uncompressed data (#4127)Gravatar Ciro Spaciari 5-7/+1143
* streams non compressed data in 64kb chunks (at least) * fmt * wip remove pause * fix default streaming and buffering * fix atomic lags * fix size * make chunked encoding work again (WIP streaming chunked) * WIP: chunked encoding streaming * fix end of streamings * working streaming + compression * add fixes + tests * fmt + fix proxy * fix oopsies * codegen after merge * fmt + fixes * more fixes * more fixes and logs * avoid double free * check empty before pop * check empty on pop * fix copy to real when complete * remove unnecessary logs * better has_schedule_callback swap, body locked size helper, remove isEmpty from unbounded_queue pop * fix response ref, fix body_size * add deflate support, fix error throw, add more tests * codegen after merge * remove logs, add connection close test * fix macOS build * fix redirect error option * make body_size more clear * support new Reponse(response) * toString DOMWrapper objects properly instead of supporting response in Response constructor * ignore headers with no name, add more tests * oops * handle transform with fetch * add gz image stream test * remove duplicate test * fix missing chunk on macOS under pressure * oops include all OS * some fixes * compare buffers instead of sizes * refactor err.err and protect it
2023-08-21Implement FileGravatar Jarred Sumner 2-1/+4
2023-08-12Fix worker event loop ref/unref + leak (#4114)Gravatar dave caruso 8-22/+77
* make more tests pass * worker changes * fix some bugs * remove this * progress * uh * okay * remove console log * a * comment assert for later * mergable state * remove test * remove test
2023-08-08worker tests (#4058)Gravatar dave caruso 2-1/+51
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-08Enable `Headers.prototype.getSetCookie`Gravatar Jarred Sumner 1-2/+1
Fixes #4057
2023-08-07Add `env` option for `node:worker_threads` (#4052)Gravatar dave caruso 4-1/+145
* almost works * env stuff * test fixes * wtfmove * ok * ok * ref by default * it now does the ref stuff by default * cool
2023-08-07implement fetching data urls (#4000)Gravatar Dylan Conway 1-0/+109
* fetch data urls * `byteSlice` * deinit slice * allocate `mime_type` string if needed * `content_type_allocated` and uncomment tests * `str_` * createAtom and slice decode result
2023-08-07fix iterating headers with `set-cookie` (#4048)Gravatar Dylan Conway 1-5/+13
* fix iterating headers with `set-cookie` * a test * move work to `HTTPHeaderMap::set` * append set-cookie after sort * remove compare function
2023-08-01close `BroadcastChannel` in testsGravatar Dylan Conway 2-1/+49
2023-08-01add `BroadcastChannel` (#3922)Gravatar Dylan Conway 3-14/+166
* copy and format * update `SerializedScriptValue.cpp` * use `expect().fail()` in message channel tests * rename `BroadcastChannelIdentifier.h` * copy registries * progress and tests * cleanup * worker and broadcast channel test * `BroadcastChannel` ref and unref * `MessagePort` ref, unref, and hasRef * remove `SecurityContext.cpp/h` * add types
2023-08-01Update worker.test.tsGravatar Dylan Conway 1-1/+1
2023-08-01Implement Worker.prototype.threadIdGravatar Jarred Sumner 1-0/+1
2023-07-31Add a test for TransformStreamGravatar Jarred Sumner 1-4/+43
2023-07-30Fix memory leak in response.clone(), further reduce memory usage of Request ↵Gravatar Jarred Sumner 2-6/+39
& Response (#3902) * Atomize respsone.url & response.statusText * Fix warning * Atomize Request & Response URLs when possible * Fix memory leak in response.clone() bun/bench/snippets on  jarred/atomize ❯ mem bun --smol request-response-clone.mjs cpu: Apple M1 Max runtime: bun 0.7.2 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 -------------------------------------------------------- ----------------------------- req.clone().url 77.3 ns/iter (40.35 ns … 222.64 ns) 91.53 ns 128.11 ns 172.78 ns resp.clone().url 162.43 ns/iter (116 ns … 337.77 ns) 177.4 ns 232.38 ns 262.65 ns Peak memory usage: 60 MB bun/bench/snippets on  jarred/atomize ❯ mem bun-0.7.1 --smol request-response-clone.mjs cpu: Apple M1 Max runtime: bun 0.7.1 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 -------------------------------------------------------- ----------------------------- req.clone().url 115.85 ns/iter (80.35 ns … 247.39 ns) 128.19 ns 181.93 ns 207.23 ns resp.clone().url 252.32 ns/iter (202.6 ns … 351.07 ns) 266.56 ns 325.88 ns 334.73 ns Peak memory usage: 1179 MB * Update tests * Update js_ast.zig * Update test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-28fix types and add message channel/port gc testGravatar Dylan Conway 1-3/+15
2023-07-28`MessageChannel` and `MessagePort` (#3860)Gravatar Dylan Conway 4-1/+270
* copy and format * copy * copy * cleanup * some tests * spellcheck * add types * don't lock getting contextId * array buffer test
2023-07-28Support file: URLs in `fetch` (#3858)Gravatar Jarred Sumner 2-0/+11
* Support file: URLs in `fetch` * Update url.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-28Fixes #3795 (#3856)Gravatar Jarred Sumner 2-0/+37
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27Make readFile() async (#3850)Gravatar Jarred Sumner 1-1/+2
* less leaky * async readfile * Update types.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-24test gardeningGravatar Jarred Sumner 2-2/+2
2023-07-24Make this test less flakyGravatar Jarred Sumner 2-3/+6
2023-07-20Update text-decoder.test.jsGravatar Jarred Sumner 1-1/+1
2023-07-20Pass constructor arguments to TextDecoder (#3692)Gravatar Julian 1-0/+19
* Make TextDecoder constructor use options parameter The constructor now actually sets TextDecoder properties using the options parameter. * Defer decoder allocation to end of constructor * Verify types of TextDecoder options * TextDecoder throw TypeError on failure * Tidying
2023-07-19Support streams in response.formData() & request.formData, introduce ↵Gravatar Jarred Sumner 2-4/+173
Bun.readableStreamToFormData() (#3697) * codegen * FormData.from * Fixes #3225 * Introduce `Bun.readableStreamToFormData` * Update bun.d.ts * Add examples * add --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-19Inline`bun` object from workersGravatar Jarred Sumner 1-3/+1
2023-07-17Fix crash in console.log(urlSearchParams) on a URLSearchParams object with a ↵Gravatar Jarred Sumner 1-0/+87
lot of keys
2023-07-16Implement Workers (#3645)Gravatar Jarred Sumner 3-0/+75
* copy files * format * options * Introduce `Worker`, `onmessage`, `onerror`, and `postMessage` globals * Stub `Worker.prototype.ref` & `Worker.prototype.unref` * Update web_worker.zig * Worker works * Add "mini" mode * add wakeup * Partially fix the keep-alive issue * clean up refer behavior * Implement `serialize` & `deserialize` in `bun:jsc` & add polyfill for `node:v8` * Types & docs * Update globals.d.ts * Add mutex * Fixes --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-14structured clone (#3637)Gravatar Dylan Conway 2-0/+249
* copy `SerializedScriptValue` * format * make `SerializedScriptValue` compile * add `transfer` option * tests * serialize/deserialize blobs * tests for blobs * serialize/deserialize file blobs * more tests * small cleanup * format * small changes + serialize offset * slice helper * map and set test
2023-07-13Implement `ping()`, `pong()`, `terminate()` for WebSocket client and server ↵Gravatar Ashcon Partovi 2-0/+374
(#3257)
2023-07-11Fix: console.log with class constructors (#3602)Gravatar dave caruso 2-1/+13
* Fix console.log with class constructors * oops * fix it * lol * fix test
2023-07-09fix metadata bits of uuid (`randomUUID()`) (#3583)Gravatar Ai Hoshino 1-0/+19
* fix uuid version Close: https://github.com/oven-sh/bun/issues/3575 * add unittest * small fix * avoid unnecessary copying
2023-07-07Update types, partially fix `typecheck` (#3551)Gravatar Colin McDonnell 2-10/+14
* Update types * Remove caret
2023-07-06fix query without slash (#3547)Gravatar Ciro Spaciari 1-0/+4
2023-07-05Fixes #3512 (#3526)Gravatar Jarred Sumner 6-2/+87
* Fixes #3512 * Fix `clearTimeout` and `clearInterval` not cancelling jobs same-tick --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-03Allow zero length WebSocket client & server messages (#3488)Gravatar Jarred Sumner 1-7/+27
* Allow zero length WebSocket client & server messages * Add test * Clean this up a little * Clean up these tests a little * Hopefully fix the test failure in release build * Don't copy into the receive buffer * Less flaky --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-03[tls] add socket parameter, setServername and ALPNprotocols support (#3457)Gravatar Ciro Spaciari 2-0/+36
* add socket parameter support * refactor #socket * add test and more fixs * some fixes * bump uws * handlers fix * more fixes * fix node net and node tls tests * fix duplicate port * fix deinit on CallbackJobs * cleanup * add setImmediate repro * add test to setImmediate * this is necessary? * fix prependOnce on native listener * try to findout the error on nodemailer CI * show error message * Update bun.lockb * prettier * Use exact versions of packages * add alpnProtocol support * update * emit error when connect fails on net.Socket * format * fix _write and cleanup * fixup * fix connect, add alpn test * fix socket.io * add socket parameter to TLSSocket * add TLSSocket socket first parameter * fixup and _start * remove flask tests * fmt --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-02set content-length 0 in some cases (#3503)Gravatar dave caruso 1-0/+19
2023-07-02Use fast path for Base64 in `btoa` (#3504)Gravatar Jarred Sumner 1-6/+3
* Use fast path for Base64 in `atob` * Fix utf16, crash on linux --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-01Make this test less flakyGravatar Jarred Sumner 1-1/+1
2023-05-31Support FormData & file uploads in `fetch` body (#3123)Gravatar Jarred Sumner 1-0/+119
* Fixes #2264 * fixup * Don't leak HTTP headers * Include the mime type. It's cleaner --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-26fixupGravatar Jarred Sumner 1-1/+1
2023-05-26Pretty formatter for `Headers` & `URLSearchParams` (#3081)Gravatar Jarred Sumner 4-32/+128
* Pretty formatter for `Headers` & `URLSearchParams` * cleanup * console.log on Headers, FormData, URLSearchParams will always quote the keys now --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-22Fix memory leak in `fetch(url)` (#2989)Gravatar Jarred Sumner 3-0/+115
* Fix memory leak in `fetch(url)` * Bump those numbers up --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-21[WebSocket] Implement `"nodebuffer"` binaryTypeGravatar Jarred Sumner 1-0/+60
2023-05-19console.log changes (#2966)Gravatar Jarred Sumner 2-64/+64
* [breaking] Don't quote property names of identifiers in console.log * Make UTF-16 strings green * always quote for jest * update tests * Update this --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-15Fix bug with `req.url` set incorrectly (#2881)Gravatar Jarred Sumner 1-0/+15
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-14feat(Timer.refresh) add refresh support on Timer (#2874)Gravatar Ciro Spaciari 2-0/+73
* add refresh support on Timer * fix this return * add refresh setTimeout tests * fix tests and add setInterval test * use setCached for arguments and callback --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-05-10feat(fetch) add redirect: 'error' support (#2845)Gravatar Ciro Spaciari 1-0/+21
* add redirect: 'error' support * fix typo * fix typo * refactor FetchRedirect enum * fix FetchRedirect * updated