Title: test runner (--test, node:test) subtest test context lack `.skip`, `.only` and `.todo` functions · Issue #50665 · nodejs/node · GitHub
Open Graph Title: test runner (--test, node:test) subtest test context lack `.skip`, `.only` and `.todo` functions · Issue #50665 · nodejs/node
X Title: test runner (--test, node:test) subtest test context lack `.skip`, `.only` and `.todo` functions · Issue #50665 · nodejs/node
Description: Version 20.7.0 Platform Linux void-desktop 6.5.9_1 #1 SMP PREEMPT_DYNAMIC Thu Oct 26 12:11:50 UTC 2023 x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? const test = require('node:test'); test('Parent', t => { t.t...
Open Graph Description: Version 20.7.0 Platform Linux void-desktop 6.5.9_1 #1 SMP PREEMPT_DYNAMIC Thu Oct 26 12:11:50 UTC 2023 x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? const test = require...
X Description: Version 20.7.0 Platform Linux void-desktop 6.5.9_1 #1 SMP PREEMPT_DYNAMIC Thu Oct 26 12:11:50 UTC 2023 x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? const test = require...
Opengraph URL: https://github.com/nodejs/node/issues/50665
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test runner (--test, node:test) subtest test context lack `.skip`, `.only` and `.todo` functions","articleBody":"### Version\r\n\r\n20.7.0\r\n\r\n### Platform\r\n\r\nLinux void-desktop 6.5.9_1 #1 SMP PREEMPT_DYNAMIC Thu Oct 26 12:11:50 UTC 2023 x86_64 GNU/Linux\r\n\r\n### Subsystem\r\n\r\n_No response_\r\n\r\n### What steps will reproduce the bug?\r\n\r\n```js\r\nconst test = require('node:test');\r\n\r\ntest('Parent', t => {\r\n\tt.test.only('Child only', () => {});\r\n\tt.test.skip('Child skip', () => {});\r\n\tt.test.todo('Child todo', () => {});\r\n});\r\n```\r\n\r\nRun with `node --test \u003cfile>` (same result without the `--test` flag)\r\n\r\n\r\n\r\n\r\n### How often does it reproduce? Is there a required condition?\r\n\r\nConsistently\r\n\r\n### What is the expected behavior? Why is that the expected behavior?\r\n\r\nAll functions work as described here: https://nodejs.org/docs/latest-v20.x/api/test.html#subtests\r\n\r\n> This method behaves identically to the top level test() function. The following example demonstrates the creation of a top level test with two subtests.\r\n\r\n### What do you see instead?\r\n\r\n```\r\nTypeError [Error]: t.test.todo is not a function\r\n```\r\n\r\n```\r\nTypeError [Error]: t.test.skip is not a function\r\n```\r\n\r\n```\r\nTypeError [Error]: t.test.only is not a function\r\n```\r\n\r\n### Additional information\r\n\r\nThese functions work for top-level test, they don't work for nested tests.\r\nMaybe it doesn't make sense to expose those functions for subtests (use just `describe` - maybe it's enough), but in that case the documentation is misleading","author":{"url":"https://github.com/soanvig","@type":"Person","name":"soanvig"},"datePublished":"2023-11-11T01:37:18Z","url":"https://github.com/nodejs/node/issues/50665"}
| 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:17758515-00a8-10d0-2414-89bf4d3eff5f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CED6:19B3CF:5AB8A8:72A555:6B035015 |
| html-safe-nonce | b593ba07b5d2f3c4e1688c644ad7967cb3b849e37996a744787a7333f3f6554d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUQ2OjE5QjNDRjo1QUI4QTg6NzJBNTU1OjZCMDM1MDE1IiwidmlzaXRvcl9pZCI6IjEyMTk2OTk5ODg2MzI5MTU5ODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 035b17626002044912e85334f39371cdecb81fd65bb8982d336bee933d1a4d6b |
| hovercard-subject-tag | issue:1988636890 |
| 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/50665/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9dfc133148d162b1b286e7c2c14cf044747609adaf27c26b6c1b25222415f80a/nodejs/node/issues/50665 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9dfc133148d162b1b286e7c2c14cf044747609adaf27c26b6c1b25222415f80a/nodejs/node/issues/50665 |
| og:image:alt | Version 20.7.0 Platform Linux void-desktop 6.5.9_1 #1 SMP PREEMPT_DYNAMIC Thu Oct 26 12:11:50 UTC 2023 x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? const test = require... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | soanvig |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-2 |
| 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