aboutsummaryrefslogtreecommitdiff
path: root/test/js/web (follow)
AgeCommit message (Collapse)AuthorFilesLines
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
2023-05-10Clean-up 85b4be5f7189e51e63672ddc874e7c6e09ae8befGravatar Jarred Sumner 1-0/+10
- We don't need to make `Bun__fetch` exported in every C++ header file - We shouldn't return JSObjectRef, its an unnecessary wrapper - The version of `fetch` on the Bun global should be non-configurable so that it is safe for anyone who wants to use that without a user-modifiable one
2023-05-10fix(fetch) fix fetch inheritance (#2842)Gravatar Ciro Spaciari 1-0/+5
* patch fetch function inheritance * fmt * fix reserveCapacity and number of arguments for fetch * change Bun.fetch to use Fetch.jsFunction * merge Fetch.jsFunction and Fetch.call * remove commented code
2023-04-06Add last modify field "mtime" for FileBlob (#1431) (#2491)Gravatar Zhongwei Yao 1-0/+1
* Add lastModified field for FileBlob (#1431) lastModified value is epoch timestamp in millisecond unit. * update according to review comment.
2023-03-28More bug fixes (#2486)Gravatar Jarred Sumner 3-176/+230
* readline_promises test fix * fix `escapeHTML` for baseline builds * fs test fixes, use `tmpdir()` * add paths for `resolve.test.js` * isError with toString symbol and error prototype * comment about `toString` * skip async macro transform * test cleanup, skip stack format test * readline undo and redo fix * capture error from readline keypress * Update tcp-server.test.ts * use `removefileat` for recursive rmdir * use strong for `signal.reason` * initialize `m_flags` * directory with file fs test * recursive option * import expect * could be less than * move abort signal tests to another process * fix typecheck --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-03-22A couple bug fixes (#2458)Gravatar Dylan Conway 3-3/+65
* fix valid status code range * update path * highwatermark option * throw DOMException * remove extra transpiler output * more transpiler tests * comment * get index not quickly * replace with `getDirectIndex` * update abort test * throw out of range status code * promisify test fix * move stdio test instance files * working crypto tests * allow duplicate set-cookie headers * different formatting * revert, fix will be in different pr * it is called * use min buffer size * fix url tests * null origin for other protocols * remove overload * add very large file test * await * coerce to int64 * 64 * no cast * add todo blob url tests * use `tryConvertToInt52`
2023-03-22Fix types (#2453)Gravatar Colin McDonnell 5-38/+44
* WIP * WIP * WIP * WIP * Improve typechecking in type files * Fix typechecking * Update * Update submodule * CI for typechecking * Add ci * Update commands * Format after build * Dont use bunx * Rename job * Use nodemodules prettier * Update workflow * Use symlink * Debug * Debug * Clean up and rename jobs
2023-03-19Remove usages of port numbers in testsGravatar Jarred Sumner 4-242/+261
2023-03-19Several bug fixes (#2427)Gravatar Jarred Sumner 3-7/+38
* Fix test * Fix segfault when unexpected type is passed in `expect().toThrow` * Fix issues with request constructor * Don't bother cloning headers when its empty * woops * more tests * fix incorrect test * Make the fetch error messages better * Update response.zig * Fix test that failed on macOS * Fix test * Remove extra hash table lookups * Support running dummy registry directly cc @alexlamsl * Update test * Update test * fixup * Workaround crash in test runner * Fixup test * Fixup test * Update os.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-180 length body is a null streamGravatar Jarred Sumner 1-2/+3
2023-03-18Hanging abort testGravatar Jarred Sumner 1-1/+3
2023-03-18Make this test more thoroughGravatar Jarred Sumner 1-2/+12
2023-03-18[fetch] Make the default body value `null` when unspecifiedGravatar Jarred Sumner 1-0/+39
This is better aligned with the fetch spec
2023-03-18Fix several bugs (#2418)Gravatar Dylan Conway 1-0/+9
* utf16 codepoint with replacement character * Fix test failure with `TextEncoder("ascii')` * Add missing type * Fix Response.prototype.bodyUsed and Request.prototype.bodyUsed * Fix bug with scrypt error not clearing * Update server.zig * oopsie
2023-03-17Fix various fetch/response/request tests (#2416)Gravatar Dylan Conway 4-39/+189
* fix most fetch tests, skip a few * fastGet, toValueGC, and invalid init * bigint unreachable, range error, log process as process * remove extra fetch_headers * remove js_type parameter, check isObject() * throw invalid mime type error, use enum literal * switch back to promise rejection * RangeError pascal case
2023-03-15remove trailing commaGravatar Dylan Conway 1-4/+4
2023-03-14Implement `toMatchSnapshot()` (#2294)Gravatar Dylan Conway 2-66/+66
* buggy snapshot * error output for failed snapshot * missing first * hints * open dir once, better cleanup * update flag * truncate on update * object and class snapshot formatting * array formatting * no function name, single item is empty array * string objects, maps, sets, promise * avoid using invalid memory * handle number objects * handle extending `Number` * boolean objects * snapshot tests and test updates * snapshot format for buffers * safer snapshot parsing * property matchers setup * strings and tests * generate classes with empty prototype * optional `propertyMatchers` parameter * new test folder structure * strings.eqlLong * globalObject.throwPretty() and expect.any tests * add updateSnapshot flag to help * move snapshot format out of `printErrorlikeObject` * empty object snapshot format * separate typed array, remove trailing comma * use `isCell`, object trailing commas * handle unicode * todo for primitive constructors * switch to `JSC.Node.Syscall.open` and `JSC.Maybe` * use js parser for snapshot files * deinit ast, log parse error * copy/paste most of `exports.ZigConsoleClient` * remove snapshot option * remove ordered properties option * remove snapshot format option from `exports.zig` * remove extra newlines * change mode * update test runner output * escape backticks faster * `bunx jest` in temp dir * remove buffered writer * add `toMatchSnapshot` to types * cleanup, switch to `pread` * cli `--update` flag * `--update-snapshots` * remove string object format
2023-03-14Add tests for AbortSignal, AbortControllerGravatar Ashcon Partovi 2-12/+173