Title: Log file name in node test reported · Issue #67680 · nodejs/node · GitHub
Open Graph Title: Log file name in node test reported · Issue #67680 · nodejs/node
X Title: Log file name in node test reported · Issue #67680 · nodejs/node
Description: What is the problem this feature will solve? Say you have two test files, test/a.js and test/b.js. Both files have the following content: import { describe, test } from 'node:test' describe('describe block A', () => { test('test case A',...
Open Graph Description: What is the problem this feature will solve? Say you have two test files, test/a.js and test/b.js. Both files have the following content: import { describe, test } from 'node:test' describe('descri...
X Description: What is the problem this feature will solve? Say you have two test files, test/a.js and test/b.js. Both files have the following content: import { describe, test } from 'node:test' describe...
Opengraph URL: https://github.com/nodejs/node/issues/67680
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Log file name in node test reported","articleBody":"### What is the problem this feature will solve?\n\nSay you have two test files, `test/a.js` and `test/b.js`. Both files have the following content:\n\n```js\nimport { describe, test } from 'node:test'\n\ndescribe('describe block A', () => {\n test('test case A', () => {})\n\n test('test case B', () => {})\n})\n\ndescribe('describe block B', () => {\n test('test case A', () => {})\n\n test('test case B', () => {})\n})\n```\n\nThere’s also an empty file named `testc.js`.\n\nIf you run `node --test`, this emits:\n\n```console\n$ node --test\n▶ describe block A\n ✔ test case A (0.408184ms)\n ✔ test case B (3.565091ms)\n✔ describe block A (4.674605ms)\n▶ describe block B\n ✔ test case A (0.087119ms)\n ✔ test case B (0.06021ms)\n✔ describe block B (0.275746ms)\n▶ describe block A\n ✔ test case A (0.410494ms)\n ✔ test case B (3.642989ms)\n✔ describe block A (4.863342ms)\n▶ describe block B\n ✔ test case A (0.193488ms)\n ✔ test case B (0.120418ms)\n✔ describe block B (0.575732ms)\n✔ test/c.js (21.739458ms)\nℹ tests 9\nℹ suites 4\nℹ pass 9\nℹ fail 0\nℹ cancelled 0\nℹ skipped 0\nℹ todo 0\nℹ duration_ms 52.575358\n```\n\nThe problem here is that `test/a.js` and `test/b.js` log the exact same output. It’s not obvious which describe blocks or test cases ran in which file. The status of `test/c.js` is logged, because it contains no tests.\n\nThis example is contrived of course, but it’s not unthinkable that two or more files have the same top-level describe block or test names.\n\n### What is the feature you are proposing to solve the problem?\n\nLog a test file name the same way as a describe block:\n\n```\n▶ test/a.js\n ▶ describe block A\n ✔ test case A (0.408184ms)\n ✔ test case B (3.565091ms)\n ✔ describe block A (4.674605ms)\n ▶ describe block B\n ✔ test case A (0.087119ms)\n ✔ test case B (0.06021ms)\n ✔ describe block B (0.275746ms)\n✔ test/a.js (…ms)\n▶ test/b.js\n ▶ describe block A\n ✔ test case A (0.410494ms)\n ✔ test case B (3.642989ms)\n ✔ describe block A (4.863342ms)\n ▶ describe block B\n ✔ test case A (0.193488ms)\n ✔ test case B (0.120418ms)\n ✔ describe block B (0.575732ms)\n✔ test/b.js (…ms)\n✔ test/c.js (21.739458ms)\nℹ tests 9\nℹ suites 4\nℹ pass 9\nℹ fail 0\nℹ cancelled 0\nℹ skipped 0\nℹ todo 0\nℹ duration_ms 52.575358\n```\n\n### What alternatives have you considered?\n\n1. The file name could be logged at the top of the bottom of the file’s output without indenting the rest of the output.\n2. The file name may or may not be omitted from logging if there’s only one test file.","author":{"url":"https://github.com/remcohaszing","@type":"Person","name":"remcohaszing"},"datePublished":"2026-11-21T15:14:58Z","url":"https://github.com/nodejs/node/issues/67680"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:1acc8f30-fab5-99c2-47d9-84f1d16424c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9582:1649B1:38689B:4A22D1:6B061971 |
| html-safe-nonce | 195916eeadaf46015704762cc85d9bf13fdd5926d736980666a0f8bc48c0ccf4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTgyOjE2NDlCMTozODY4OUI6NEEyMkQxOjZCMDYxOTcxIiwidmlzaXRvcl9pZCI6IjgwNzA0NTQ5MTkyMDUwOTk4ODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 946c0a4569901c45c6a673daef1d40fcdbf08d5429738a153e9fcf67d6b9e707 |
| hovercard-subject-tag | issue:6530604639 |
| 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/67680/issue_layout |
| twitter:image | https://opengraph.githubassets.com/23be1f905b8f4b9d5e10c6474c8998a74618a7b599946980e57a84ad462d9385/nodejs/node/issues/67680 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/23be1f905b8f4b9d5e10c6474c8998a74618a7b599946980e57a84ad462d9385/nodejs/node/issues/67680 |
| og:image:alt | What is the problem this feature will solve? Say you have two test files, test/a.js and test/b.js. Both files have the following content: import { describe, test } from 'node:test' describe('descri... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | remcohaszing |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| 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 | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width