Title: test runner run() ignores testNamePatterns and testSkipPatterns when isolation is "none" · Issue #57399 · nodejs/node · GitHub
Open Graph Title: test runner run() ignores testNamePatterns and testSkipPatterns when isolation is "none" · Issue #57399 · nodejs/node
X Title: test runner run() ignores testNamePatterns and testSkipPatterns when isolation is "none" · Issue #57399 · nodejs/node
Description: Version v22.14.0, v23.8.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem test What steps will reproduce the bug? mytest.test.mjs import { test } from "node:test"; test("a1", (t) => { console.log(t.name); }); test("a2", (t) => {...
Open Graph Description: Version v22.14.0, v23.8.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem test What steps will reproduce the bug? mytest.test.mjs import { test } from "node:test"; test("a1", (t) => { cons...
X Description: Version v22.14.0, v23.8.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem test What steps will reproduce the bug? mytest.test.mjs import { test } from "node:test"; test("a1&...
Opengraph URL: https://github.com/nodejs/node/issues/57399
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test runner run() ignores testNamePatterns and testSkipPatterns when isolation is \"none\"","articleBody":"### Version\n\nv22.14.0, v23.8.0\n\n### Platform\n\n```text\nMicrosoft Windows NT 10.0.19045.0 x64\n```\n\n### Subsystem\n\ntest\n\n### What steps will reproduce the bug?\n\n## mytest.test.mjs\n```\nimport { test } from \"node:test\";\n\ntest(\"a1\", (t) => {\n console.log(t.name);\n});\n\ntest(\"a2\", (t) => {\n console.log(t.name);\n});\n\ntest(\"b1\", (t) => {\n console.log(t.name);\n});\n```\n\n## run.mjs\n```js\nimport * as test from \"node:test\";\nimport { spec } from \"node:test/reporters\";\n\ntest\n .run({\n globPatterns: [\"mytest.test.mjs\"],\n testNamePatterns: [\"a\"],\n testSkipPatterns: [\"a2\"],\n isolation: \"none\",\n })\n .compose(spec)\n .pipe(process.stdout);\n```\n\n## output\n```\na1\na2\nb1\n✔ a1 (1.1461ms)\n✔ a2 (0.2373ms)\n✔ b1 (0.2315ms)\n```\nthat is incorrect, only a1 should run.\n\n\n\n### How often does it reproduce? Is there a required condition?\n\nalways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nexpected behavior is to run only a1\n```\na1\n✔ a1 (1.1336ms)\n```\n\nbecause\n- a2 should be skipped by testSkipPatterns: [\"a2\"]\n- b1 should be discarded by testNamePatterns: [\"a\"]\n\n\n\n\n\n### What do you see instead?\n\n```\na1\na2\nb1\n✔ a1 (1.1461ms)\n✔ a2 (0.2373ms)\n✔ b1 (0.2315ms)\n```\n\n### Additional information\n\nUsing isolation: \"process\" has the expected behavior\n\nrepor code: https://github.com/galdebert/repro-bug-node-test-runner","author":{"url":"https://github.com/galdebert","@type":"Person","name":"galdebert"},"datePublished":"2025-03-10T12:41:49Z","url":"https://github.com/nodejs/node/issues/57399"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:082a510f-15ef-917d-95df-748730626fed |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A8B0:3CE69D:7B22F1:A05E83:6AED35D8 |
| html-safe-nonce | a7964924c98eb653e193cdeb383d1d65528b737da526da413311a8b6f66b45e7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEIwOjNDRTY5RDo3QjIyRjE6QTA1RTgzOjZBRUQzNUQ4IiwidmlzaXRvcl9pZCI6IjE2NDUwMDM4NTk0ODc5NjI1ODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a102564f71347fcba1ba00545b6cda8e3dc65a068adbc5c1965b80f09712e12b |
| hovercard-subject-tag | issue:2907148743 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/57399/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f27c0c509fc4a22b5b7f53630b913ecf771ea970cc0c4990600f3ca2721f7242/nodejs/node/issues/57399 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f27c0c509fc4a22b5b7f53630b913ecf771ea970cc0c4990600f3ca2721f7242/nodejs/node/issues/57399 |
| og:image:alt | Version v22.14.0, v23.8.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem test What steps will reproduce the bug? mytest.test.mjs import { test } from "node:test"; test("a1", (t) => { cons... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | galdebert |
| hostname | github.com |
| expected-hostname | github.com |
| None | 26c92a9388ddfad3fa88d132b5d5f0b4747030233dcc4e5efb05f1cbae152184 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c629ad99c254d306375fc8354d04321c2c362236 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width