Commit Graph

355 Commits

Author SHA1 Message Date
Joyee Cheung
3e31baeda6
esm: use sync loading/resolving on non-loader-hook thread
ESM resolution and loading is now always synchronous from a
non-loader-hook thread. If no asynchrnous loader hooks are
registered, the resolution/loading is entirely synchronous.
If asynchronous loader hooks are registered, these would be
synchronous on the non-loader-hook thread, and asynchronous
on the loader hook thread.

This avoids several races caused by async/sync loading sharing
the same cache. In particular, asynchronous loader hooks
now works with `require(esm)` - previously it tends to break
due to races.

In addition, when an asynchronous loader hook
returns a promise that never settles, the main thread no longer
silently exits with exit code 13, leaving the code below
any module loading calls silently ignored without being executed.
Instead, it now throws ERR_ASYNC_LOADER_REQUEST_NEVER_SETTLED
which can be caught and handled by the main thread. If the module
request comes from `import()`, the never-settling promise is
now relayed to the result returned by `import()`.

Drive-by: when annotating the error about importing undetectable
named exports from CommonJS, it now no longer reload the source
code of the CommonJS module, and instead reuses format information
cached when the module was loaded for linking.

PR-URL: https://github.com/nodejs/node/pull/60380
Fixes: https://github.com/nodejs/node/issues/59666
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
2025-10-31 20:45:10 +00:00
Joyee Cheung
f46d501b7f
test_runner: use module.registerHooks in module mocks
Migrate away from module.register(). This no longer needs to
deal with the worker synchronization.

PR-URL: https://github.com/nodejs/node/pull/60326
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2025-10-22 11:05:39 +00:00
Ruben Bridgewater
d3f79aa65d
assert: allow printf-style messages as assertion error
Also add functions as allowed message input.
This allows to have leavy message computation to become cheaper.

PR-URL: https://github.com/nodejs/node/pull/58849
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-10-17 20:15:17 +00:00
Moshe Atlow
6dbf7086bb
test_runner: fix suite timeout
PR-URL: https://github.com/nodejs/node/pull/59853
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-10-09 04:40:05 +00:00
sangwook
f0aa073907 test_runner: add junit file attribute support
Add file attribute to JUnit testcase elements when file information
is available in test event data.

PR-URL: https://github.com/nodejs/node/pull/59432
Fixes: https://github.com/nodejs/node/issues/59422
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-10-08 12:27:36 +00:00
Moshe Atlow
2258f22672
test_runner: fix todo inheritance
PR-URL: https://github.com/nodejs/node/pull/59721
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-09-04 09:35:48 +00:00
hotpineapple
ec8c73d6ca
test_runner: set mock timer's interval undefined
prevent adding timer to execution queue if clearInterval() called

PR-URL: https://github.com/nodejs/node/pull/59479
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-27 03:36:54 +00:00
René
52f616d42f
test_runner: do not error when getting fullName of root context
PR-URL: https://github.com/nodejs/node/pull/59377
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-08-23 19:40:58 +00:00
Moshe Atlow
64355ae97e
test_runner: add option to rerun only failed tests
PR-URL: https://github.com/nodejs/node/pull/59443
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-19 07:42:00 +00:00
Pietro Marchini
abb1f92347
src: add internal GetOptionsAsFlags
PR-URL: https://github.com/nodejs/node/pull/59138
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-16 06:43:49 +00:00
Sungwon
f7a2ba7e83
test_runner: fix isSkipped check in junit
The `isSkipped` function in the JUnit reporter was incorrectly
checking for `node?.attrs.failures` instead of `node?.attrs.skipped`.

PR-URL: https://github.com/nodejs/node/pull/59414
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-08-13 08:50:42 +00:00
Shima Ryuhei
220f5c644e
test: exclude mock from coverage
Fixes: https://github.com/nodejs/node/issues/59112
PR-URL: https://github.com/nodejs/node/pull/59348
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-08-11 05:49:53 +00:00
Alex Yang
f904fa77f8
test_runner: remove unused callee convertion
PR-URL: https://github.com/nodejs/node/pull/59221
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-07-29 00:21:37 -07:00
Yagiz Nizipli
0fd1ecded6
meta: enable jsdoc/check-tag-names rule
PR-URL: https://github.com/nodejs/node/pull/58521
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-07-18 09:28:21 +00:00
René
e3e739de63
test_runner: clean up promisified interval generation
* yield from loop instead of setting up custom iterator
* cancel abort listener on exit
* do not call <Array>.at(0)

PR-URL: https://github.com/nodejs/node/pull/58824
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-07-10 20:15:31 +00:00
Pietro Marchini
61a0b12c80
test_runner: correctly filter --experimental-config-file
PR-URL: https://github.com/nodejs/node/pull/58833
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-06-29 20:48:29 +00:00
jakecastelli
94f7568e5c
test_runner: fix timeout not propagated to the child process in run
PR-URL: https://github.com/nodejs/node/pull/58831
Fixes: https://github.com/nodejs/node/issues/58802
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Adrian Estrada <edsadr@gmail.com>
2025-06-27 11:50:17 +00:00
Jacob Smith
5b0c7dba0e
test_runner: correct "already mocked" error punctuation placement
PR-URL: https://github.com/nodejs/node/pull/58840
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-06-26 20:01:15 +00:00
cjihrig
dff081e01f
test_runner: automatically wait for subtests to finish
This commit updates the test runner to automatically wait for
subtests to finish. This makes the experience more consistent
with suites and removes the need to await anything.

PR-URL: https://github.com/nodejs/node/pull/58800
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-06-24 11:02:46 -03:00
Romain Menke
bf86e025a5 Revert "test_runner: remove promises returned by t.test()"
This reverts commit 1a2eb15bc6.

PR-URL: https://github.com/nodejs/node/pull/58282
Fixes: https://github.com/nodejs/node/issues/58227
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-06-23 09:37:40 +00:00
Romain Menke
9a1c0bc07a Revert "test_runner: remove promises returned by test()"
This reverts commit 96718268fe.

PR-URL: https://github.com/nodejs/node/pull/58282
Fixes: https://github.com/nodejs/node/issues/58227
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-06-23 09:37:40 +00:00
Romain Menke
7a0c74b4ea Revert "test_runner: automatically wait for subtests to finish"
This reverts commit aa3523ec22.

PR-URL: https://github.com/nodejs/node/pull/58282
Fixes: https://github.com/nodejs/node/issues/58227
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-06-23 09:37:39 +00:00
Renegade334
ef2e0848ba
test_runner: prefer Atomics primordials
PR-URL: https://github.com/nodejs/node/pull/58716
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-06-17 16:53:58 +02:00
Idan Goshen
905a722df3
test_runner: support object property mocking
PR-URL: https://github.com/nodejs/node/pull/58438
Fixes: https://github.com/nodejs/node/issues/58322
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-06-09 17:57:07 +00:00
Pietro Marchini
c1f090dc76
src: support namespace options in configuration file
PR-URL: https://github.com/nodejs/node/pull/58073
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Giovanni Bucci <github@puskin.it>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
2025-06-06 12:47:05 +00:00
Jacopo Martinelli
95249083ea
test_runner: emit event when file changes in watch mode
PR-URL: https://github.com/nodejs/node/pull/57903
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2025-05-30 19:32:11 +00:00
Jacopo Martinelli
38757c906d
test_runner: add level parameter to reporter.diagnostic
Added a parameter to allow severity-based formatting for
diagnostic messages. Defaults to 'info'.
This update enables better control over message presentation
(e.g., coloring) based on severity levels such as 'info', 'warn',
and 'error'.

Refs: https://github.com/nodejs/node/issues/55922
PR-URL: https://github.com/nodejs/node/pull/57923
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-05-19 08:28:05 +00:00
Théo LUDWIG
264cad75ce
Revert "test_runner: change ts default glob"
This reverts commit 9df0ff7015.

PR-URL: https://github.com/nodejs/node/pull/58202
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-05-09 05:54:29 +00:00
Marco Ippolito
8ccfcb5adc
lib: fix sourcemaps with ts module mocking
PR-URL: https://github.com/nodejs/node/pull/58193
Fixes: https://github.com/nodejs/node/issues/58119
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-05-08 15:14:22 +00:00
Pietro Marchini
7e24ebc780
test_runner: unify --require and --import behavior when isolation none
PR-URL: https://github.com/nodejs/node/pull/57924
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-05-06 06:28:29 +00:00
Jacob Smith
cf896c3b12
test_runner: support mocking json modules
PR-URL: https://github.com/nodejs/node/pull/58007
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-04-26 14:56:24 +00:00
Pietro Marchini
cb5f671a34
test_runner: add global setup and teardown functionality
PR-URL: https://github.com/nodejs/node/pull/57438
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-04-16 17:51:06 +00:00
Pietro Marchini
8e4e4df91a
test_runner: recalculate run duration on watch restart
PR-URL: https://github.com/nodejs/node/pull/57786
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-04-16 15:38:50 +00:00
Shima Ryuhei
f89baf2e2a
test_runner: match minimum file column to 'all files'
PR-URL: https://github.com/nodejs/node/pull/57848
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2025-04-14 13:40:19 +00:00
jakecastelli
67786c1270
test_runner: improve --test-timeout to be per test
Previously `--test-timeout` is set on per test execution, this is
obviously a bug as per test execution is hard to be expected, this patch
addresses the issue by setting `timeout` from per execution to per test.

This patch also fixes a minor issue that `--test-timeout` is not being
respected when running without `--test`.

PR-URL: https://github.com/nodejs/node/pull/57672
Fixes: https://github.com/nodejs/node/issues/57656
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-04-09 14:36:19 +00:00
Gürgün Dayıoğlu
a20acd407d
lib: limit split function calls to prevent excessive array length
PR-URL: https://github.com/nodejs/node/pull/57501
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
2025-03-18 15:52:50 +00:00
Marco Ippolito
9df0ff7015
test_runner: change ts default glob
PR-URL: https://github.com/nodejs/node/pull/57359
Fixes: https://github.com/nodejs/node/issues/56546
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-03-09 12:55:40 +00:00
Pietro Marchini
8c2df73db6
test_runner: refactor testPlan counter increse
PR-URL: https://github.com/nodejs/node/pull/56765
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-02-23 20:31:14 +00:00
Carlos Espa
baa60ce03c
test_runner: allow special characters in snapshot keys
Fixes: https://github.com/nodejs/node/issues/56836
PR-URL: https://github.com/nodejs/node/pull/57017
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-02-19 06:34:08 +00:00
dependabot[bot]
211171fe2c
tools: bump eslint version
Bumps the eslint group in /tools/eslint with 5 updates:

| Package | From | To |
| --- | --- | --- |
| `@babel/core` | `7.26.0` | `7.26.7` |
| `@babel/eslint-parser` | `7.25.9` | `7.26.5` |
| `@stylistic/eslint-plugin-js` | `2.12.1` | `3.0.1` |
| `eslint` | `9.17.0` | `9.19.0` |
| `eslint-plugin-jsdoc` | `50.6.1` | `50.6.3` |

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/56869
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-02-11 13:32:26 +00:00
Pietro Marchini
a2aa6ca9d7
test_runner: print formatted errors on summary
PR-URL: https://github.com/nodejs/node/pull/56911
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-09 18:03:38 +00:00
cjihrig
1a2eb15bc6 test_runner: remove promises returned by t.test()
This commit updates the TestContext.prototype.test() API to no
longer return a Promise.

Fixes: https://github.com/nodejs/node/issues/51292
PR-URL: https://github.com/nodejs/node/pull/56664
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-01-31 12:56:03 -08:00
cjihrig
96718268fe test_runner: remove promises returned by test()
This commit updates the test() and suite() APIs to no longer
return a Promise.

Fixes: https://github.com/nodejs/node/issues/51292
PR-URL: https://github.com/nodejs/node/pull/56664
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-01-31 12:56:02 -08:00
cjihrig
aa3523ec22 test_runner: automatically wait for subtests to finish
This commit updates the test runner to automatically wait for
subtests to finish. This makes the experience more consistent
with suites and removes the need to await anything.

PR-URL: https://github.com/nodejs/node/pull/56664
Fixes: https://github.com/nodejs/node/issues/51292
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-01-31 12:55:59 -08:00
Pietro Marchini
c752615e2b test_runner: print failing assertion only once with spec reporter
Co-authored-by: Llorx <dallorx@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/56662
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-01-24 08:23:29 -08:00
Colin Ihrig
0e7ec5e7a1
test_runner: add TestContext.prototype.waitFor()
This commit adds a waitFor() method to the TestContext class in
the test runner. As the name implies, this method allows tests to
more easily wait for things to happen.

PR-URL: https://github.com/nodejs/node/pull/56595
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2025-01-16 02:32:37 +00:00
Colin Ihrig
19c8cc12ce
test_runner: add t.assert.fileSnapshot()
This commit adds a t.assert.fileSnapshot() API to the test runner.
This is similar to how snapshot tests work in core, as well as
userland options such as toMatchFileSnapshot().

PR-URL: https://github.com/nodejs/node/pull/56459
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-01-09 21:12:17 +00:00
Eddie Abbondanzio
383e1a281b
test_runner: differentiate test types in enqueue dequeue events
PR-URL: https://github.com/nodejs/node/pull/54049
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-01-05 08:35:35 +00:00
Colin Ihrig
4a7b8157b5
test_runner: add assert.register() API
This commit adds a top level assert.register() API to the test
runner. This function allows users to define their own custom
assertion functions on the TestContext.

Fixes: https://github.com/nodejs/node/issues/52033
PR-URL: https://github.com/nodejs/node/pull/56434
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-01-04 18:30:04 +00:00
Colin Ihrig
afafee2a30
test_runner: finish marking snapshot testing as stable
Snapshot testing was marked stable in #55897. These were
overlooked at the time.

Refs: https://github.com/nodejs/node/pull/55897
PR-URL: https://github.com/nodejs/node/pull/56425
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-01-03 18:24:51 +00:00