Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
3660 commits
Select commit Hold shift + click to select a range
3d5e7cd
report: fix recent coverity warning
mhdawson Jul 28, 2023
6f9d6f2
crypto: remove default encoding from sign/verify
tniessen Aug 15, 2023
3578bee
src: add per-realm GetBindingData() method
joyeecheung Aug 3, 2023
6391b3b
src: use per-realm GetBindingData() wherever applicable
joyeecheung Aug 3, 2023
034c801
test: add expectSyncExitWithoutError() and expectSyncExit() utils
joyeecheung Aug 4, 2023
a3f12e4
test: use expectSyncExit{WithErrors} in snapshot tests
joyeecheung Aug 4, 2023
556e95a
test: add test for effect of UV_THREADPOOL_SIZE
tniessen Aug 16, 2023
8ed4397
crypto: remove default encoding from Hash/Hmac
tniessen Aug 16, 2023
7215176
crypto: remove default encoding from DiffieHellman
tniessen Aug 16, 2023
c64c914
test: make WeakReference tests robust
joyeecheung Aug 7, 2023
8dcce52
lib: implement WeakReference on top of JS WeakRef
joyeecheung Aug 7, 2023
a49bc4b
src: remove C++ WeakReference implementation
joyeecheung Aug 7, 2023
e2d666d
tools: fix github reporter appended multiple times
MoLow Aug 16, 2023
c9b1d6c
deps: update simdutf to 3.2.17
nodejs-github-bot Aug 4, 2023
b4a2be4
vm: store MicrotaskQueue in ContextifyContext directly
joyeecheung Aug 16, 2023
6bb400f
lib: add api to detect whether source-maps are enabled
sapphi-red Aug 17, 2023
769823e
src: add built-in `.env` file support
anonrig Aug 17, 2023
4c3db74
doc: add rluvaton to collaborators
rluvaton Aug 17, 2023
fe219e0
bootstrap: do not generate code cache in an unfinalized isolate
joyeecheung Aug 17, 2023
a5567c2
test_runner: expose spec reporter as newable function
atlowChemi Aug 17, 2023
3c6a1c6
meta: add test/reporters to codeowners
atlowChemi Aug 17, 2023
413c16e
src,permission: add multiple allow-fs-* flags
Ceres6 Aug 17, 2023
c4bbf0a
doc: fix wording in napi_async_init
tniessen Aug 17, 2023
478ca18
doc: update to semver-minor releases by default
RafaelGSS Aug 17, 2023
3af6585
doc: add h1 summary to security release process
RafaelGSS Aug 17, 2023
7d5d640
doc: add notable-change label mention to PR template
RafaelGSS Aug 17, 2023
c021b27
meta: mention nodejs/tsc when changing GH templates
RafaelGSS Aug 17, 2023
7b7a68b
bootstrap: build code cache from deserialized isolate
joyeecheung Aug 18, 2023
1f2ad05
test: use gcUntil() in test-v8-serialize-leak
joyeecheung Aug 18, 2023
ecde9d9
test: make test-perf-hooks more robust and work with workers
joyeecheung Aug 18, 2023
64a5c01
test: add spawnSyncAndExit() and spawnSyncAndExitWithoutError()
joyeecheung Aug 18, 2023
78842cf
crypto: remove getDefaultEncoding()
tniessen Aug 14, 2023
cb4a6fa
doc: use same name in the doc as in the code
illusi0n7 Aug 19, 2023
41a3a1d
doc: caveat unavailability of `import.meta.resolve` in custom loaders
JakobJingleheimer Aug 19, 2023
5026293
build: expand when we run internet tests
mhdawson Aug 19, 2023
0daea96
test: reduce flakiness of `test-esm-loader-hooks`
aduh95 Aug 20, 2023
2557932
esm: align sync and async load implementations
aduh95 Aug 20, 2023
45e5ec8
src: add a condition if the argument of `DomainToUnicode` is empty
Aug 20, 2023
982e7a6
src: use ARES_SUCCESS instead of 0
Aug 20, 2023
484ad83
doc: add signature for `module.register`
GeoffreyBooth Aug 20, 2023
052434a
test: use `tmpdir.resolve()`
LiviaMedeiros Aug 21, 2023
eeddbfa
test,benchmark: use `tmpdir.fileURL()`
LiviaMedeiros Aug 21, 2023
a16b610
src: remove unused function `GetName()` in node_perf
Aug 21, 2023
62b2cf3
doc: clarify use of Uint8Array for n-api
indutny Aug 21, 2023
f6f1131
src: support snapshot deserialization in RAIIIsolate
joyeecheung Aug 18, 2023
5c9daf4
sea: generate code cache with deserialized isolate
joyeecheung Aug 18, 2023
164c57d
doc: move and rename loaders section
GeoffreyBooth Aug 22, 2023
56a2a2e
doc: update description for `percent_encode` sets in `WHATWG API`
Aug 23, 2023
0d080a2
meta: move one or more collaborators to emeritus
nodejs-github-bot Aug 23, 2023
bca14f8
worker: protect against user mutating well-known prototypes
aduh95 Aug 23, 2023
e74d1b8
doc: fix typo in `stream.finished` documentation
aduh95 Aug 23, 2023
ee1f609
test: handle EUNATCH
abmusse May 17, 2023
996f390
doc: use NODE_API_SUPPORTED_VERSION_MAX in release doc
zcbenz Aug 21, 2023
feb5b0f
fs: make sure to write entire buffer
ronag Mar 22, 2022
da197d1
deps: update zlib to 1.2.13.1-motley-f5fd0ad
nodejs-github-bot Aug 24, 2023
b0f4233
stream: add `highWaterMark` for the map operator
rluvaton Aug 24, 2023
5ff1ead
build: add symlink to `compile_commands.json` file if needed
juanarbol Aug 24, 2023
a494ef6
doc: modify param description for end(),write() in `StringDecoder`
Aug 24, 2023
6117cc3
test: fix compiler warning in NodeCryptoEnv
tniessen Aug 24, 2023
33710e7
doc: update module hooks docs
GeoffreyBooth Aug 24, 2023
c5cad08
fs: remove redundant code in readableWebStream()
deokjinkim Aug 25, 2023
460c19f
doc: avoid "not currently recommended"
tniessen Aug 25, 2023
69f7583
policy: fix path to URL conversion
aduh95 Aug 26, 2023
3d0a317
doc: add riscv64 to list of architectures
sxa Aug 26, 2023
4178683
doc: update `options.filter` description for `fs.cp`
shubham9411 Aug 26, 2023
1ca23ad
tools: update lint-md-dependencies
nodejs-github-bot Aug 20, 2023
4ba7370
stream: use Buffer.from when constructor is a Buffer
KhafraDev Aug 26, 2023
76e659a
fs: add the options param description in openAsBlob()
LEEYS96 Aug 26, 2023
fee0601
doc: use `cjs` as block code's type in `MockTimers`
deokjinkim Aug 26, 2023
56c3263
doc: update outdated reference to NIST SP 800-131A
tniessen Aug 26, 2023
5a07777
crypto: do not overwrite _writableState.defaultEncoding
tniessen Aug 27, 2023
b9153af
doc: add print results for examples in `StringDecoder`
Aug 27, 2023
0409cdd
tools: remove v8_dump_build_config action
zcbenz Aug 27, 2023
9eb84fe
doc: clarify policy expectations
RafaelGSS Aug 28, 2023
7e7aad8
tools: update lint-md-dependencies
nodejs-github-bot Aug 29, 2023
7104a71
tools: update eslint to 8.48.0
nodejs-github-bot Aug 29, 2023
9cd70f4
test: migrate message source map tests from Python to JS
Aug 29, 2023
0ebd088
crypto: update root certificates to NSS 3.93
nodejs-github-bot Aug 29, 2023
452bae1
test: rename test-crypto-modp1-error
tniessen Aug 29, 2023
43704dd
src: rename IsAnyByteSource to IsAnyBufferSource
tniessen Aug 29, 2023
eccdbe2
doc: add news issue for Diagnostics WG
mhdawson Aug 24, 2023
9848352
node-api: fix compiler warning in node_api.h
graebm Aug 30, 2023
fcf5de0
benchmark: use `tmpdir.resolve()`
LiviaMedeiros Aug 30, 2023
3a6a80a
test_runner: report covered lines, functions and branches to reporters
philnash Aug 30, 2023
c750049
test_runner: add support for setImmediate
ErickWendel Aug 31, 2023
a81d5e1
doc,test: add known path resolution issue in permission model
tniessen Aug 31, 2023
7224940
test: split test-crypto-keygen.js
joyeecheung Aug 17, 2023
b9a6ab5
test: split JWK async elliptic curve keygen tests
joyeecheung Aug 17, 2023
b781eaf
test: reduce length in crypto keygen tests
joyeecheung Aug 17, 2023
f863117
url: handle unicode hostname if empty
anonrig Aug 31, 2023
dcf6670
net: fix crash due to simultaneous close/shutdown on JS Stream Sockets
pimterry Aug 24, 2023
47add7e
net: use asserts in JS Socket Stream to catch races in future
pimterry Aug 25, 2023
57e78bc
url: validate `pathToFileURL(path)` argument as string
LiviaMedeiros Aug 14, 2023
ba61c07
deps: V8: cherry-pick eadaef581c29
AdamMajer Aug 31, 2023
f9a182c
doc: fix node-api call example
legendecas Aug 31, 2023
04a3567
test: verify dynamic import call with absolute path strings
legendecas Aug 31, 2023
92fb7dd
test: simplify test-crypto-dh-group-setters
tniessen Aug 31, 2023
048e0be
tls: ensure TLS Sockets are closed if the underlying wrap closes
pimterry Sep 1, 2023
457cedd
crypto: remove webcrypto EdDSA key checks and properties
panva Sep 1, 2023
295572e
src: remove unused PromiseWrap-related code
joyeecheung Sep 1, 2023
df16705
deps: add missing thread-common.c in uv.gyp
santigimeno Sep 1, 2023
ce11e00
src: modify code for empty string
Sep 1, 2023
12ee988
meta: remove modules team from CODEOWNERS
benjamingr Sep 1, 2023
ea32c3c
test: fix warning for comment in embedtest
Sep 2, 2023
0add7a8
tls: refactor to use validateFunction
deokjinkim Sep 2, 2023
8e82cfc
test_runner: preserve original property descriptor
ErickWendel Sep 3, 2023
b98d2e2
meta: bump actions/setup-node from 3.7.0 to 3.8.1
dependabot[bot] Sep 3, 2023
f777f3f
meta: bump actions/checkout from 3.5.3 to 3.6.0
dependabot[bot] Sep 3, 2023
8dfe424
meta: bump step-security/harden-runner from 2.5.0 to 2.5.1
dependabot[bot] Sep 3, 2023
c8628ed
tls: remove redundant code in onConnectSecure()
deokjinkim Sep 4, 2023
1235426
2023-09-04, Version 20.6.0 (Current)
UlisesGascon Aug 15, 2023
4d0f930
bootstrap: only use the isolate snapshot when compiling code cache
joyeecheung Aug 18, 2023
0028fd1
build: add --write-snapshot-as-array-literals to configure.py
joyeecheung Aug 24, 2023
47c5152
test_runner: fix typescript coverage
MoLow Sep 4, 2023
7f001c2
test: make test-worker-prof more robust
joyeecheung Sep 4, 2023
e11c7b7
doc: edit `import.meta.resolve` documentation
aduh95 Sep 5, 2023
56dfcae
deps: update corepack to 0.20.0
nodejs-github-bot Sep 5, 2023
6a5394e
esm: refactor mocking test
GeoffreyBooth Sep 5, 2023
5b31ff1
tools: update doc dependencies
nodejs-github-bot Sep 5, 2023
f139cc3
test_runner: add jsdocs to MockTimers
ErickWendel Sep 5, 2023
e79ef81
doc: updated releasers instructions for node.js website
ovflowd Sep 5, 2023
21759bd
test: add test for urlstrings usage in `node:fs`
LiviaMedeiros Sep 5, 2023
a61bc9d
test_runner: fix invalid timer call
ErickWendel Sep 5, 2023
5402185
process: add custom dir support for heapsnapshot-signal
MrJithil May 20, 2023
d8eb8d0
doc: fix documentation for fs.createWriteStream highWaterMark option
mertcanaltin Sep 6, 2023
cfe4166
lib: check SharedArrayBuffer availability in freeze_intrinsics.js
miniak Sep 6, 2023
fdc65d9
esm: fix loading of CJS modules from ESM
aduh95 Sep 6, 2023
6919d72
doc: fix missing imports in `test.run` code examples
OshriAsulin Sep 6, 2023
306de76
deps: upgrade npm to 10.0.0
npm-cli-bot Sep 6, 2023
6b135a1
doc: fix documentation for input option in child_process
ariel-weiss Sep 6, 2023
a927ade
esm: refactor test-esm-named-exports
GeoffreyBooth Sep 4, 2023
63c3846
esm: refactor test-esm-loader-resolve-type
GeoffreyBooth Sep 4, 2023
65f63d4
meta: bump rtCamp/action-slack-notify from 2.2.0 to 2.2.1
dependabot[bot] Sep 7, 2023
8024a9a
meta: bump github/codeql-action from 2.21.2 to 2.21.5
dependabot[bot] Sep 7, 2023
c9019cc
tools: configure never-stale label correctly
targos Sep 7, 2023
a33a497
doc: cast GetInternalField() return type to v8::Value in addons.md
joyeecheung Sep 7, 2023
9c7b7be
deps: update googletest to 8a6feab
nodejs-github-bot Sep 7, 2023
f0ebb77
test: make `test-dotenv-node-options` locale-independent
LiviaMedeiros Sep 7, 2023
941ad8b
src: do not rely on the internal field being default to undefined
joyeecheung Sep 7, 2023
c86e700
src: fix comment on StreamResource
ywave620 Aug 16, 2023
def014d
tools: allow passing absolute path of config.gypi in js2c
zcbenz Sep 7, 2023
e6fce82
doc: close a parenthesis
regseb Sep 7, 2023
b3c4f66
doc: add release key for Ulises Gascon
UlisesGascon Sep 7, 2023
e0fb3f7
test: split test-crypto-dh to avoid timeout on slow machines in the CI
joyeecheung Sep 7, 2023
cd49408
doc: update outdated history info
aduh95 Sep 7, 2023
0bce573
src: fix fs_type_to_name default value
0o001 Sep 7, 2023
015e27b
src: don't overwrite environment from .env file
philnash Sep 8, 2023
7db6e18
src: set ModuleWrap internal fields only once
joyeecheung Sep 8, 2023
3163f8d
gyp: put cctest filenames in variables
zcbenz Sep 8, 2023
7bf29b5
benchmark: fix webstream pipe-to
rluvaton Sep 8, 2023
8103a64
doc: rename possibly confusing variable and CSS class
aduh95 Sep 8, 2023
718981e
doc: update documentation for node:process warning
shubham9411 Sep 8, 2023
0a2ab4c
2023-09-08, Version 20.6.1 (Current)
RafaelGSS Sep 7, 2023
b64c3ee
esm: remove return value for `Module.register`
aduh95 Sep 9, 2023
5bb0cb2
typings: fix missing property in `ExportedHooks`
aduh95 Sep 9, 2023
a4d0629
deps: upgrade npm to 10.1.0
npm-cli-bot Sep 9, 2023
b500037
doc: save user preference for JS flavor
eldoy Sep 9, 2023
479a50c
test: isolate `globalPreload` tests
GeoffreyBooth Sep 9, 2023
c159b90
test: increase coverage of `Module.register` and `initialize` hook
aduh95 Sep 10, 2023
ce30b4e
src: support multiple `--env-file` declarations
anonrig Sep 10, 2023
705e623
esm: remove `globalPreload` hook (superseded by `initialize`)
JakobJingleheimer Sep 10, 2023
ae115d6
zlib: disable CRC32 SIMD optimization
lpinca Sep 10, 2023
178dff2
test: avoid copying test source files
legendecas Sep 6, 2023
c55625f
Revert "test: ignore the copied entry_point.c"
legendecas Sep 7, 2023
afea87e
lib: use internal `pathToFileURL`
LiviaMedeiros Sep 10, 2023
b3fc917
lib: use internal `fileURLToPath`
deokjinkim Sep 10, 2023
a7fe8b0
stream: improve tee perf by reduce `ReflectConstruct` usages
rluvaton Sep 11, 2023
a3020dd
src: allow embedders to override NODE_MODULE_VERSION
zcbenz Sep 11, 2023
f970087
deps: V8: backport 93b1a74cbc9b
joyeecheung Sep 11, 2023
b0edb28
test: skip test-child-process-pipe-dataflow.js on Windows
joyeecheung Sep 11, 2023
17a9bfb
src: set --rehash-snapshot explicitly
joyeecheung Sep 11, 2023
dca4d84
test: use setImmediate() in test-heapdump-shadowrealm.js
joyeecheung Sep 11, 2023
31657f7
test: use spawnSyncAndExitWithoutError in test/common/sea.js
joyeecheung Sep 7, 2023
65d396b
test: use spawnSyncAndExitWithoutError in sea tests
joyeecheung Sep 7, 2023
48fcb20
test: mark test-http-regr-gh-2928 as flaky
joyeecheung Sep 11, 2023
d8b378c
fs: fix readdir and opendir recursive with unknown file types
lux01 Sep 11, 2023
d3e0331
errors: use `determineSpecificType` in more error messages
aduh95 Sep 11, 2023
b046a11
tools: update lint-md-dependencies to [email protected] [email protected]
nodejs-github-bot Sep 12, 2023
e4d1259
tools: update eslint to 8.49.0
nodejs-github-bot Sep 12, 2023
668437c
deps: V8: cherry-pick b60a03df4ceb
joyeecheung Sep 12, 2023
b45e196
test: show more info on failure in test-cli-syntax-require.js
joyeecheung Sep 12, 2023
4e39830
build: bump supported macOS and Xcode versions
targos Aug 14, 2023
2a14a79
esm: set all hooks as release candidate
GeoffreyBooth Sep 13, 2023
ccf46ba
test: deflake test-tls-socket-close
lpinca Sep 13, 2023
2a0e5de
debugger: use `internal/url.URL` instead of `url.parse`
LiviaMedeiros Sep 11, 2023
f5bb2c7
tools: restrict internal code from using public `url` module
LiviaMedeiros Sep 11, 2023
7ad4c0f
benchmark: shorten pipe-to by reducing number of chunks
rluvaton Sep 13, 2023
4e01842
net: improve performance of isIPv4 and isIPv6
Uzlopak Sep 13, 2023
4efa374
test_runner: add jsdocs to mock.js
ocodista Sep 14, 2023
22907ce
test_runner: add junit reporter
MoLow Sep 14, 2023
1a4ae46
test_runner: fix test runner watch mode when no positional arguments
MoLow Sep 14, 2023
b289c6d
test: mark test-runner-watch-mode as flaky
joyeecheung Sep 14, 2023
bc9a875
module: use symbol in WeakMap to manage host defined options
joyeecheung Jun 21, 2023
4aa6b8c
module: fix leak of vm.SyntheticModule
joyeecheung Jun 21, 2023
2dfaee4
module: fix the leak in SourceTextModule and ContextifySript
joyeecheung Jun 23, 2023
44084b8
doc: mark Node.js 16 as End-of-Life
richardlau Sep 14, 2023
ba28cd8
doc: remove `@anonrig` from performance initiative
anonrig Sep 13, 2023
dac5f29
test: skip test-child-process-stdio-reuse-readable-stdio on Windows
joyeecheung Sep 14, 2023
6a489df
esm: clarify ERR_REQUIRE_ESM errors
danielcompton Sep 15, 2023
f42a103
esm: require braces for modules code
GeoffreyBooth Sep 15, 2023
db8217b
errors: improve classRegExp in errors.js
Uzlopak Sep 16, 2023
ae73d48
doc: update `corepack.md` to account for 0.20.0 changes
aduh95 Sep 16, 2023
71b90fa
doc: deprecate calling `promisify` on a function that returns a promise
aduh95 Sep 16, 2023
e9ff810
deps: update llhttp to 9.1.2
ShogunPanda Sep 16, 2023
56ecf29
esm: fix support for `URL` instances in `register`
aduh95 Sep 17, 2023
36ab510
src: remove unused variable
targos Sep 17, 2023
c177ac0
deps: update nghttp2 to 1.56.0
nodejs-github-bot Sep 17, 2023
7e12d0e
fs: improve error performance of sync methods
anonrig Sep 17, 2023
a71e3a6
test: fix edge snapshot stack traces
GeoffreyBooth Sep 17, 2023
cdcb01a
doc: alphabetize cli.md sections
GeoffreyBooth Sep 17, 2023
07e8539
bootstrap: do not expand argv1 for snapshots
joyeecheung Sep 5, 2023
76ac548
test: fix argument computation in embedtest
joyeecheung Sep 5, 2023
1995eca
build: run embedtest using node executable
joyeecheung Sep 5, 2023
553169f
src: port Pipe to uv_pipe_bind2, uv_pipe_connect2
ggoodman Sep 18, 2023
ccca547
util: runtime deprecate `promisify`-ing a function returning a `Promise`
aduh95 Sep 18, 2023
b03a757
src: use SNAPSHOT_SERDES to log snapshot ser/deserialization
joyeecheung Sep 18, 2023
5c39ee6
stream: improve webstream readable async iterator performance
rluvaton Sep 18, 2023
b651e37
2023-09-18, Version 20.7.0 (Current)
UlisesGascon Sep 10, 2023
18e00a5
test: deflake test-http-regr-gh-2928
lpinca Sep 9, 2023
18eaf03
test: add checkIfCollectable to test/common/gc.js
joyeecheung Sep 16, 2023
9322bcd
test: use checkIfCollectable in vm leak tests
joyeecheung Sep 16, 2023
78ab0ee
2023-09-18, Version 18.18.0 'Hydrogen' (LTS)
ruyadorno Sep 17, 2023
d847895
tools: update lint-md-dependencies to [email protected]
nodejs-github-bot Sep 19, 2023
7517c9f
module, esm: jsdoc for modules files
GeoffreyBooth Sep 19, 2023
f91b4e2
esm: update loaders warning
GeoffreyBooth Sep 19, 2023
2ccfb23
tools: fix uvwasi updater
mhdawson Sep 19, 2023
cd97e28
benchmark: add a benchmark for read() of ReadableStreams
debadree25 Sep 19, 2023
f72784b
doc: fix print results in `events`
Sep 19, 2023
1149d6b
doc: link maintaining deps to pull-request.md
marco-ippolito Sep 19, 2023
346abdd
stream: improve readable webstream `pipeTo`
rluvaton Sep 19, 2023
cdad3d8
test: use `fs.constants` for `fs.access` constants
LiviaMedeiros Sep 20, 2023
20b996d
esm: fix return type of `import.meta.resolve`
aduh95 Sep 20, 2023
fd14063
doc: add missing history info for `import.meta.resolve`
aduh95 Sep 20, 2023
b64f620
doc: fix history comments
aduh95 Sep 20, 2023
480ab8c
Revert "test: mark test-http-regr-gh-2928 as flaky"
lpinca Sep 20, 2023
718a1cf
test,crypto: update WebCryptoAPI WPT
panva Sep 21, 2023
4858826
doc: add missed `inspect` with numericSeparator to example
deokjinkim Sep 21, 2023
f7414a8
repl: don't accumulate excess indentation in .load
STRd6 Sep 21, 2023
05ebb8e
doc: update output of example in `mimeParams.set()`
deokjinkim Sep 21, 2023
fa74158
doc: add missing function call to example for `util.promisify`
Sep 21, 2023
b7d836e
lib: reset the cwd cache before execution
arcanis Sep 21, 2023
571ecbf
fs: improve error performance of `opendirSync`
anonrig Sep 21, 2023
2e4e1e1
meta: add primordials strategic initiative
benjamingr Sep 21, 2023
a4c7f81
test_runner: catch reporter errors
MoLow Sep 21, 2023
3116c37
doc: deprecate `util.toUSVString`
anonrig Sep 21, 2023
85172c3
src: remove unnecessary todo
RafaelGSS Sep 21, 2023
853f572
test: migrate message error tests from Python to JS
Sep 21, 2023
9718a94
meta: fix linter error
aduh95 Sep 21, 2023
23a3410
lib: allow byob reader for 'blob.stream()'
debadree25 Sep 22, 2023
9be6419
test_runner: add shards support
rluvaton Jul 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test_runner: add junit reporter
PR-URL: #49614
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
MoLow authored Sep 14, 2023
commit 22907ce3668b69543acb07f293817f092e03a267
7 changes: 5 additions & 2 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ The following built-reporters are supported:
where each passing test is represented by a `.`,
and each failing test is represented by a `X`.

* `junit`
The junit reporter outputs test results in a jUnit XML format

When `stdout` is a [TTY][], the `spec` reporter is used by default.
Otherwise, the `tap` reporter is used by default.

Expand All @@ -643,11 +646,11 @@ to the test runner's output is required, use the events emitted by the
The reporters are available via the `node:test/reporters` module:

```mjs
import { tap, spec, dot } from 'node:test/reporters';
import { tap, spec, dot, junit } from 'node:test/reporters';
```

```cjs
const { tap, spec, dot } = require('node:test/reporters');
const { tap, spec, dot, junit } = require('node:test/reporters');
```

### Custom reporters
Expand Down
158 changes: 158 additions & 0 deletions lib/internal/test_runner/reporter/junit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
'use strict';
const {
ArrayPrototypeFilter,
ArrayPrototypeMap,
ArrayPrototypeJoin,
ArrayPrototypePush,
ArrayPrototypeSome,
NumberPrototypeToFixed,
ObjectEntries,
RegExpPrototypeSymbolReplace,
String,
StringPrototypeRepeat,
} = primordials;

const { inspectWithNoCustomRetry } = require('internal/errors');
const { hostname } = require('os');

const inspectOptions = { __proto__: null, colors: false, breakLength: Infinity };
const HOSTNAME = hostname();

function escapeAttribute(s = '') {
return escapeContent(RegExpPrototypeSymbolReplace(/"/g, RegExpPrototypeSymbolReplace(/\n/g, s, ''), '&quot;'));
}

function escapeContent(s = '') {
return RegExpPrototypeSymbolReplace(/</g, RegExpPrototypeSymbolReplace(/&/g, s, '&amp;'), '&lt;');
}

function escapeComment(s = '') {
return RegExpPrototypeSymbolReplace(/--/g, s, '&#45;&#45;');
}

function treeToXML(tree) {
if (typeof tree === 'string') {
return `${escapeContent(tree)}\n`;
}
const {
tag, attrs, nesting, children, comment,
} = tree;
const indent = StringPrototypeRepeat('\t', nesting + 1);
if (comment) {
return `${indent}<!-- ${escapeComment(comment)} -->\n`;
}
const attrsString = ArrayPrototypeJoin(ArrayPrototypeMap(ObjectEntries(attrs)
, ({ 0: key, 1: value }) => `${key}="${escapeAttribute(String(value))}"`)
, ' ');
if (!children?.length) {
return `${indent}<${tag} ${attrsString}/>\n`;
}
const childrenString = ArrayPrototypeJoin(ArrayPrototypeMap(children ?? [], treeToXML), '');
return `${indent}<${tag} ${attrsString}>\n${childrenString}${indent}</${tag}>\n`;
}

function isFailure(node) {
return (node?.children && ArrayPrototypeSome(node.children, (c) => c.tag === 'failure')) || node?.attrs?.failures;
}

function isSkipped(node) {
return (node?.children && ArrayPrototypeSome(node.children, (c) => c.tag === 'skipped')) || node?.attrs?.failures;
}

module.exports = async function* junitReporter(source) {
yield '<?xml version="1.0" encoding="utf-8"?>\n';
yield '<testsuites>\n';
let currentSuite = null;
const roots = [];

function startTest(event) {
const originalSuite = currentSuite;
currentSuite = {
__proto__: null,
attrs: { __proto__: null, name: event.data.name },
nesting: event.data.nesting,
parent: currentSuite,
children: [],
};
if (originalSuite?.children) {
ArrayPrototypePush(originalSuite.children, currentSuite);
}
if (!currentSuite.parent) {
ArrayPrototypePush(roots, currentSuite);
}
}

for await (const event of source) {
switch (event.type) {
case 'test:start': {
startTest(event);
break;
}
case 'test:pass':
case 'test:fail': {
if (!currentSuite) {
startTest({ __proto__: null, data: { __proto__: null, name: 'root', nesting: 0 } });
}
if (currentSuite.attrs.name !== event.data.name ||
currentSuite.nesting !== event.data.nesting) {
startTest(event);
}
const currentTest = currentSuite;
if (currentSuite?.nesting === event.data.nesting) {
currentSuite = currentSuite.parent;
}
currentTest.attrs.time = NumberPrototypeToFixed(event.data.details.duration_ms / 1000, 6);
const nonCommentChildren = ArrayPrototypeFilter(currentTest.children, (c) => c.comment == null);
if (nonCommentChildren.length > 0) {
currentTest.tag = 'testsuite';
currentTest.attrs.disabled = 0;
currentTest.attrs.errors = 0;
currentTest.attrs.tests = nonCommentChildren.length;
currentTest.attrs.failures = ArrayPrototypeFilter(currentTest.children, isFailure).length;
currentTest.attrs.skipped = ArrayPrototypeFilter(currentTest.children, isSkipped).length;
currentTest.attrs.hostname = HOSTNAME;
} else {
currentTest.tag = 'testcase';
currentTest.attrs.classname = event.data.classname ?? 'test';
if (event.data.skip) {
ArrayPrototypePush(currentTest.children, {
__proto__: null, nesting: event.data.nesting + 1, tag: 'skipped',
attrs: { __proto__: null, type: 'skipped', message: event.data.skip },
});
}
if (event.data.todo) {
ArrayPrototypePush(currentTest.children, {
__proto__: null, nesting: event.data.nesting + 1, tag: 'skipped',
attrs: { __proto__: null, type: 'todo', message: event.data.todo },
});
}
if (event.type === 'test:fail') {
const error = event.data.details?.error;
currentTest.children.push({
__proto__: null,
nesting: event.data.nesting + 1,
tag: 'failure',
attrs: { __proto__: null, type: error?.failureType || error?.code, message: error?.message ?? '' },
children: [inspectWithNoCustomRetry(error, inspectOptions)],
});
currentTest.failures = 1;
currentTest.attrs.failure = error?.message ?? '';
}
}
break;
}
case 'test:diagnostic': {
const parent = currentSuite?.children ?? roots;
ArrayPrototypePush(parent, {
__proto__: null, nesting: event.data.nesting, comment: event.data.message,
});
break;
} default:
break;
}
}
for (const suite of roots) {
yield treeToXML(suite);
}
yield '</testsuites>\n';
};
1 change: 1 addition & 0 deletions lib/internal/test_runner/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const kBuiltinReporters = new SafeMap([
['spec', 'internal/test_runner/reporter/spec'],
['dot', 'internal/test_runner/reporter/dot'],
['tap', 'internal/test_runner/reporter/tap'],
['junit', 'internal/test_runner/reporter/junit'],
]);

const kDefaultReporter = process.stdout.isTTY ? 'spec' : 'tap';
Expand Down
10 changes: 10 additions & 0 deletions lib/test/reporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const { ObjectDefineProperties, ReflectConstruct } = primordials;

let dot;
let junit;
let spec;
let tap;

Expand All @@ -17,6 +18,15 @@ ObjectDefineProperties(module.exports, {
return dot;
},
},
junit: {
__proto__: null,
configurable: true,
enumerable: true,
get() {
junit ??= require('internal/test_runner/reporter/junit');
return junit;
},
},
spec: {
__proto__: null,
configurable: true,
Expand Down
7 changes: 7 additions & 0 deletions test/fixtures/test-runner/output/junit_reporter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';
require('../../../common');
const fixtures = require('../../../common/fixtures');
const spawn = require('node:child_process').spawn;

spawn(process.execPath,
['--no-warnings', '--test-reporter', 'junit', fixtures.path('test-runner/output/output.js')], { stdio: 'inherit' });
Loading