doc (test_runner): shards not supported with watch mode#50640
doc (test_runner): shards not supported with watch mode#50640nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
|
Review requested:
|
|
Why would you use sharding (A feature designed to horizontally parallelize test running across machines) with watch mode (a feature designed for development time to iterate on code quickly)? Not judging, genuinely curious. |
Not any particular reason, I was learning about node:test module from node-api docs where I found this missing. I wasn't expecting any error with the above code, If sharding is not supported with watch mode then it is better to show a warning or log instead and mark watch false internally, and run the test. Better to not judge me 😅. |
|
Should we document why sharding is not supported? |
586c0bc to
63742cf
Compare
63742cf to
b852483
Compare
|
Landed in f9675e1 |
PR-URL: nodejs#50640 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: nodejs#50640 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #50640 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #50640 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #50640 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #50640 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #50640 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #50640 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #50640 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Affected URL: https://nodejs.org/docs/latest-v20.x/api/test.html#runoptions
It's not mention that we can use shard with watch mode.
Code:
error:
node:internal/test_runner/runner:466 throw new ERR_INVALID_ARG_VALUE('options.shard', watch, 'shards not supported with watch mode'); ^ TypeError [ERR_INVALID_ARG_VALUE]: The property 'options.shard' shards not supported with watch mode. Received true at run (node:internal/test_runner/runner:466:13) at file:///Users/pulkitgupta/Desktop/node/index.test.mjs:23:1 at ModuleJob.run (node:internal/modules/esm/module_job:218:25) at async ModuleLoader.import (node:internal/modules/esm/loader:329:24) at async loadESM (node:internal/process/esm_loader:28:7) at async handleMainPromise (node:internal/modules/run_main:113:12) { code: 'ERR_INVALID_ARG_VALUE' } Node.js v22.0.0-pre