summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node
AgeCommit message (Collapse)Author
2023-12-14fix(node): return false from vm.isContext (#21568)Divy Srivastava
https://github.com/denoland/deno/issues/20851#issuecomment-1779226106 for `jsdom`
2023-12-13fix(zlib): handle no flush flag in handle_.write (#21432)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/21096
2023-12-11fix(ext/node): basic vm.runInNewContext implementation (#21527)Divy Srivastava
Simple implementation to support webpack (& Next.js): https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/javascript/JavascriptParser.js#L4329
2023-12-11fix(ext/node): ServerResponse getHeader() return undefined (#21525)Divy Srivastava
Matches Node's return type. Next.js check for `if (header === undefined)`: https://github.com/vercel/next.js/blob/e02fe314dcd0ae614c65b505c6daafbdeebb920e/packages/next/src/server/base-http/node.ts#L93
2023-12-11fix(ext/node): stub ServerResponse#flushHeaders (#21526)Divy Srivastava
This commit adds a no-op flushHeaders method to the ServerResponse object. It is a nop because the ServerResponse implementation is based on top of the Deno server API instead of the Node `OutgoingMessage` base. Fixes #21509
2023-12-08fix(ext/node): allow null value for req.setHeader (#21391)Yoshiya Hinosawa
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-12-07test(ext/node): compare free memory in log scale (#21475)Yoshiya Hinosawa
2023-12-04perf(node/fs): faster `existsSync` when not exists (#21458)David Sherret
2023-12-03fix(ext/node): sign with PEM private keys (#21287)Divy Srivastava
Add support for signing with a RSA PEM private key: `pkcs8` and `pkcs1`. Fixes https://github.com/denoland/deno/issues/18972 Ref #21124 Verified fix with `npm:sshpk`. Unverfied but fixes `npm:google-auth-library`, `npm:web-push` & `oracle/oci-typescript-sdk` --------- Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-12-02fix(node): setting process.exitCode should change exit code of process (#21429)David Sherret
2023-12-02chore: update std to 0.208.0 (#21318)Asher Gomez
Re-attempt at #21284. I was more thorough this time. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-12-01fix(ext/node): add stubbed process.report (#21373)Daniel Mizerski
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-11-30fix(ext/node): fix os.freemem (#21347)Yoshiya Hinosawa
2023-11-27fix(node): `spawnSync`'s `status` was incorrect (#21359)David Sherret
The exit code wasn't hooked up properly.
2023-11-25chore(ext/node): remove unnecessary test case (#21337)Yoshiya Hinosawa
This test case is covered by the last case in https://github.com/denoland/deno/blob/5710fffb120eba88e1b261e3ef379cb02575de42/cli/tests/node_compat/test/parallel/test-stream2-transform.js and not necessary anymore.
2023-11-24chore: deflake unit_node/crypto/crypto_key_test.ts (#21331)Bartek Iwańczuk
Ref https://github.com/denoland/deno/issues/21187 On CI we are going to run only fast tests, with an option to pass `SLOW_TESTS=1` env var to enable more comprehensive tests.
2023-11-23fix(ext/node): fix node:stream.Writable (#21297)Yoshiya Hinosawa
This change applies the same fix as https://github.com/nodejs/node/pull/46818, and the original example given in #20456 works as expected. closes #20456
2023-11-22refactor: replace `deferred()` from `std/async` with ↵Asher Gomez
`Promise.withResolvers()` (#21234) Closes #21041 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-11-22Revert "chore: update to `std@0.207.0` (#21284)" (#21295)Bartek Iwańczuk
This reverts commit 20aa0796e6ff7651cdfce4d0292bdb11da5dfe2e. `main` has been failing consistenly on `kv_undelivered_test` and `serve_test` after this upgrade.
2023-11-22chore: update to `std@0.207.0` (#21284)Asher Gomez
Closes #21002
2023-11-20fix(ext/node): handle closing process.stdin more than once (#21267)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/21112 Aligns more towards what Node.js does. Closing stdin more than once is a nop.
2023-11-14fix(ext/node): add APIs perf_hook.performance (#21192)Bartek Iwańczuk
Required for Next.js.
2023-11-11fix(node/http): export globalAgent (#21081)Jacob Hummer
Fixes #21080 Fixes #18312 --------- Signed-off-by: Jacob Hummer <jcbhmr@outlook.com>
2023-11-10fix(ext/node): implement process.geteuid (#21151)Divy Srivastava
Fixes #21097
2023-11-10fix(node/child_process): properly normalize stdio for 'spawnSync' (#21103)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/20782
2023-11-09fix(node): implement createPrivateKey (#20981)Divy Srivastava
Towards #18455
2023-11-07fix(node/http): socket.setTimeout (#20930)Gasman
Fixes #20923
2023-11-06fix(ext): use `String#toWellFormed` in ext/webidl and ext/node (#21054)Kenta Moriuchi
Fixes #18802 This PR adds `util.toUSVString` to node:util: ```js import util from "node:util"; util.toUSVString("string\ud801"); // => "string\ufffd" ```
2023-11-01fix(ext/node): adapt dynamic type checking to Node.js behavior (#21014)Kenta Moriuchi
2023-10-28Revert "chore: update deno_std submodule (#20994)" (#21001)Bartek Iwańczuk
This reverts commit 6e2abb2b13af5dff5d631fb1bc0c279c49ebd066.
2023-10-27chore: update deno_std submodule (#20994)Bartek Iwańczuk
2023-10-22fix(polyfill): correctly handle flag when its equal 0 (#20953)sigmaSd
Fixes https://github.com/denoland/deno/issues/20910
2023-10-18fix(ext/node): process.argv0 (#20925)Bartek Iwańczuk
Fixes https://github.com/denoland/deno/issues/20924
2023-10-12fix(node/http2): fixes to support grpc (#20712)Bartek Iwańczuk
This commit improves "node:http2" module implementation, by enabling to use "options.createConnection" callback when starting an HTTP2 session. This change enables to pass basic client-side test with "grpc-js/grpc" package. Smaller fixes like "Http2Session.unref()" and "Http2Session.setTimeout()" were handled as well. Fixes #16647
2023-10-05fix(ext/node): implement uv.errname (#20785)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/20617
2023-10-02fix(ext/node): don't call undefined nextTick fn (#20724)Luca Casonato
The `process` global is not defined in this file. Fixes #20441 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-09-23fix(node): supported arguments to `randomFillSync` (#20637)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/20634
2023-09-16perf: improve async op santizer speed and accuracy (#20501)Luca Casonato
This commit improves async op sanitizer speed by only delaying metrics collection if there are pending ops. This results in a speedup of around 30% for small CPU bound unit tests. It performs this check and possible delay on every collection now, fixing an issue with parent test leaks into steps.
2023-09-15feat(ext/node): http2.connect() API (#19671)Bartek Iwańczuk
This commit improves compatibility of "node:http2" module by polyfilling "connect" method and "ClientHttp2Session" class. Basic operations like streaming, header and trailer handling are working correctly. Refing/unrefing is still a TODO and "npm:grpc-js/grpc" is not yet working correctly. --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-09-08fix(ext/node/ops/zlib/brotli): Allow decompressing more than 4096 bytes (#20301)Curran McConnell
Fixes https://github.com/denoland/deno/issues/19816 In that issue, I suggest switching over the other brotli functionality to the Rust API provided by the `brotli` crate. Here, I only do that with the `brotli_decompress` function to fix the bug with buffers longer than 4096 bytes.
2023-09-06fix(ext/node): implement AES GCM cipher (#20368)Divy Srivastava
Adds support for AES-GCM 128/256 bit keys in `node:crypto` and `setAAD()`, `setAuthTag()` and `getAuthTag()` Uses https://github.com/littledivy/aead-gcm-stream Fixes https://github.com/denoland/deno/issues/19836 https://github.com/denoland/deno/issues/20353
2023-09-05fix(node/child_process): don't crash on undefined/null value of an env var ↵zuisong
(#20378) Fixes #20373 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-08-29fix(node/http): don't leak resources on destroyed request (#20040)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19828
2023-08-29fix(ext/node): fix argv[1] in Worker (#20305)Yoshiya Hinosawa
2023-08-28fix(ext/node): shared global buffer unlock correctness fix (#20314)Matt Mastracci
The fix for #20188 was not entirely correct -- we were unlocking the global buffer incorrectly. This PR introduces a lock state that ensures we only unlock a lock we have taken out.
2023-08-26fix(node): propagate create cipher errors (#20280)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/19002
2023-08-22fix(ext/node): simultaneous reads can leak into each other (#20223)Matt Mastracci
Reported in #20188 This was caused by re-use of a global buffer `BUF` during simultaneous async reads.
2023-08-18fix(node/http): emit error when addr in use (#20200)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/20186
2023-08-17feat(ext/web): resourceForReadableStream (#20180)Matt Mastracci
Extracted from fast streams work. This is a resource wrapper for `ReadableStream`, allowing us to treat all `ReadableStream` instances as resources, and remove special paths in both `fetch` and `serve`. Performance with a ReadableStream response yields ~18% improvement: ``` return new Response(new ReadableStream({ start(controller) { controller.enqueue(new Uint8Array([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])); controller.close(); } }) ``` This patch: ``` 12:36 $ third_party/prebuilt/mac/wrk http://localhost:8080 Running 10s test @ http://localhost:8080 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 99.96us 100.03us 6.65ms 98.84% Req/Sec 47.73k 2.43k 51.02k 89.11% 959308 requests in 10.10s, 117.10MB read Requests/sec: 94978.71 Transfer/sec: 11.59MB ``` main: ``` Running 10s test @ http://localhost:8080 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 163.03us 685.51us 19.73ms 99.27% Req/Sec 39.50k 3.98k 66.11k 95.52% 789582 requests in 10.10s, 82.83MB read Requests/sec: 78182.65 Transfer/sec: 8.20MB ```
2023-08-11fix(node): implement TLSSocket._start (#20120)Divy Srivastava
Closes https://github.com/denoland/deno/issues/19983 Closes https://github.com/denoland/deno/issues/18303 Closes https://github.com/denoland/deno/issues/16681 Closes https://github.com/denoland/deno/issues/19978