[node] test: mock.module can take a URL - #74486
typescript-bot merged 1 commit into
Conversation
This behavior is since nodejs/node#54416. It is in v22 since v22.8.0 (nodejs/node#54560), v24 since v24.0.0, and v25 since v25.0.0. It's not in v22. Relevant Nodejs docs: https://nodejs.org/docs/latest-v25.x/api/test.html#mockmodulespecifier-options Relevant Nodejs code: https://github.com/nodejs/node/blob/ae2ffce5f3d5ac5ad153d98839d5a19a70e073b2/lib/internal/test_runner/mock/mock.js#L619-L625 Relevant Nodejs test: https://github.com/nodejs/node/blob/ae2ffce5f3d5ac5ad153d98839d5a19a70e073b2/test/parallel/test-runner-module-mocking.js#L158-L160
|
@reillylm Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment that I will keep updated. 1 package in this PR
Code ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 74486,
"author": "reillylm",
"headCommitOid": "577ebf1f04b2da8f5a263a7b4727236334e7b02d",
"mergeBaseOid": "e6b9bf3e1e9624a311ba3681710b2592e781c7d0",
"lastPushDate": "2026-02-06T03:12:19.000Z",
"lastActivityDate": "2026-02-10T14:35:30.000Z",
"maintainerBlessed": "Waiting for Author to Merge (Blessed)",
"mergeOfferDate": "2026-02-07T01:02:42.000Z",
"mergeRequestDate": "2026-02-10T14:35:30.000Z",
"mergeRequestUser": "reillylm",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "node",
"kind": "edit",
"files": [
{
"path": "types/node/node-tests/test.ts",
"kind": "test"
},
{
"path": "types/node/test.d.ts",
"kind": "definition"
},
{
"path": "types/node/v22/test.d.ts",
"kind": "definition"
},
{
"path": "types/node/v22/test/test.ts",
"kind": "test"
},
{
"path": "types/node/v24/test.d.ts",
"kind": "definition"
},
{
"path": "types/node/v24/test/test.ts",
"kind": "test"
}
],
"owners": [
"Microsoft",
"jkomyno",
"r3nya",
"btoueg",
"touffy",
"mohsen1",
"galkin",
"eps1lon",
"WilcoBakker",
"chyzwar",
"trivikr",
"yoursunny",
"qwelias",
"ExE-Boss",
"peterblazejewicz",
"addaleax",
"victorperin",
"NodeJS",
"LinusU",
"wafuwafu13",
"mcollina",
"Semigradsky",
"Renegade334",
"anonrig"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "Renegade334",
"date": "2026-02-06T06:01:50.000Z",
"isMaintainer": false
}
],
"mainBotCommentID": 3857702864,
"ciResult": "pass"
} |
|
🔔 @microsoft @jkomyno @r3nya @btoueg @Touffy @mohsen1 @galkin @eps1lon @WilcoBakker @chyzwar @trivikr @yoursunny @qwelias @ExE-Boss @peterblazejewicz @addaleax @victorperin @nodejs @LinusU @wafuwafu13 @mcollina @Semigradsky @Renegade334 @anonrig — please review this PR in the next few days. Be sure to explicitly select |
|
@reillylm: Everything looks good here. I am ready to merge this PR (at 577ebf1) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@microsoft, @jkomyno, @r3nya, @btoueg, @Touffy, @mohsen1, @galkin, @eps1lon, @WilcoBakker, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @nodejs, @LinusU, @wafuwafu13, @mcollina, @Semigradsky, @Renegade334, @anonrig: you can do this too.) |
|
Ready to merge |
Please fill in this template.
pnpm test <package to test>.Select one of these and delete the others:
If changing an existing definition:
package.json.This behavior is since nodejs/node#54416. It is in v22 since v22.8.0 (nodejs/node#54560), v24 since v24.0.0, and v25 since v25.0.0. It's not in v22.
Relevant Nodejs docs: https://nodejs.org/docs/latest-v25.x/api/test.html#mockmodulespecifier-options
Relevant Nodejs code: https://github.com/nodejs/node/blob/ae2ffce5f3d5ac5ad153d98839d5a19a70e073b2/lib/internal/test_runner/mock/mock.js#L619-L625
Relevant Nodejs test: https://github.com/nodejs/node/blob/ae2ffce5f3d5ac5ad153d98839d5a19a70e073b2/test/parallel/test-runner-module-mocking.js#L158-L160