Title: test_runner: expectFailure should support a reason (like todo/skip) and a specific expected failure · Issue #61570 · nodejs/node · GitHub
Open Graph Title: test_runner: expectFailure should support a reason (like todo/skip) and a specific expected failure · Issue #61570 · nodejs/node
X Title: test_runner: expectFailure should support a reason (like todo/skip) and a specific expected failure · Issue #61570 · nodejs/node
Description: What is the problem this feature will solve? The new expectFailure test option should: be consistent with todo and skip test options, supporting a string value that is its reason. For example, an expectFailure might have "known issue #34...
Open Graph Description: What is the problem this feature will solve? The new expectFailure test option should: be consistent with todo and skip test options, supporting a string value that is its reason. For example, an e...
X Description: What is the problem this feature will solve? The new expectFailure test option should: be consistent with todo and skip test options, supporting a string value that is its reason. For example, an e...
Opengraph URL: https://github.com/nodejs/node/issues/61570
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_runner: expectFailure should support a reason (like todo/skip) and a specific expected failure","articleBody":"### What is the problem this feature will solve?\n\nThe new `expectFailure` test option should:\n\n1. be consistent with `todo` and `skip` test options, supporting a string value that is its *reason*.\n\n For example, an `expectFailure` might have `\"known issue #347\"` as its reason.\n\n2. support a way to specify the *specific* expected failure. If a test failure is not the originally expected failure, then the test should *not* pass. The simplest and most flexible way to do this is probably by specifying a RegExp that must match the expected failure message.\n\n For example, the failure might be expected to match `/Expected values to be strictly equal:\\s+41 !== 42/`\n\nIn addition, it should support both of the above independently. It should not be either-or. \n\n\n\n\n\n\n### What is the feature you are proposing to solve the problem?\n\nOne way to meet the above requirements is as follows:\n\n```\ntest('one', {expectFailure: true}, (t) =\u003e ...) //consistent with todo/skip\n\ntest('two', {expectFailure: \"known issue #347\"}, (t) =\u003e ...) //reason string, consistent with todo/skip\n\ntest('three', {expectFailure: /\u003cerr msg pattern\u003e/}, (t) =\u003e ...)\n\ntest('four', {expectFailure: {reason: \"known issue #347\", error:/\u003cerr msg pattern\u003e/}}, (t) =\u003e ...)\n```\n\nOr perhaps an array to specify both:\n\n```\ntest('five', {expectFailure: [\"known issue #347\", /\u003cerr msg pattern\u003e/]}, (t) =\u003e ...)\n```\n\n\nAnother way is for `expectFailure` to be exactly like `todo` and `skip`, taking only a boolean or string reason, and add a separate option for a specific expected failure:\n\n```\ntest('six', {expectFailure: \"known issue #347\", expectFailureMessage:/\u003cerr msg pattern\u003e/}, (t) =\u003e ...)\n```\n\n### What alternatives have you considered?\n\n_No response_","author":{"url":"https://github.com/vassudanagunta","@type":"Person","name":"vassudanagunta"},"datePublished":"2026-01-28T18:19:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/61570/node/issues/61570"}
| 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:ce5af80e-7d7b-cd93-5fb1-90c9bce80ce7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BBC2:306DA5:47F62F:6145B5:6A4C763C |
| html-safe-nonce | 8f3e3b0dca154722c4e98b919ad5a432ef586dcc8e7aa15916e02018450cc8a2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkMyOjMwNkRBNTo0N0Y2MkY6NjE0NUI1OjZBNEM3NjNDIiwidmlzaXRvcl9pZCI6IjI5NTA3NjA3MTg3NTA0Nzk5MzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f531fd41c7c138a5d3ec60311c122782bf449eb84fc70cbf8ec16d426847751f |
| hovercard-subject-tag | issue:3866742831 |
| 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/61570/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b96dd7f79aca623639f187678425f634c4d1724295d1ba48728f716fddbd141d/nodejs/node/issues/61570 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b96dd7f79aca623639f187678425f634c4d1724295d1ba48728f716fddbd141d/nodejs/node/issues/61570 |
| og:image:alt | What is the problem this feature will solve? The new expectFailure test option should: be consistent with todo and skip test options, supporting a string value that is its reason. For example, an e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vassudanagunta |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| 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 | 56ac743bebb13694b888673bb7257f4b97a4b7fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width