Repository navigation
Add test.todo to match it.todo in node:test #47897
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on May 6, 2023 - addedtest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
on May 7, 2023 CC @cjihrig - this does not exist mainly due to your objection so the API would remain simple. do you still object to this change?
I do still want the API to remain simple - even small changes add up. I also think this API exactly duplicates existing functionality so it doesn't really buy us anything.
That said, it keeps coming up and I'm tired of repeating myself so I won't block it.
Reacted by Moshe Atlow and Tomáš HübelbauerI honestly just find it weird to have to import
itfortodowhen I'm usingtestfor everything else. Simple API is a great goal of course, but it seems like this parity betweentestanditwould reduce surprises and align with user's expectations so as a result arguably it being the would be "simpler" in some sense. Just my 0.02 USD as a user.I didn't want to add that API for
it()either.Reacted by Moshe Atlow, Tomáš Hübelbauer and Toni Villena- addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on May 7, 2023 - added a commit that references this issue
on May 15, 2023 - added a commit that references this issue
on May 15, 2023 - added a commit that references this issue
on Jul 6, 2023 - added a commit that references this issue
on Jul 6, 2023 Hopefully not too OT but .. should we have the same for
beforeandafter, IIRC I was only able to usebeforeEachandafterEachwithtest..?
What is the problem this feature will solve?
In the Node test runner (https://nodejs.org/api/test.html#test-runner) we have
describe.todoandit.todoto designate suites/tests which do not exist yet but we're planning on adding. Thedescribe>itsyntax is one option of declaring tests, though, there is also justtestin the API. For those of us who prefertestoverdescribe, there is no shorthandtest.todo, only thetestmethodtodooption: https://nodejs.org/api/test.html#testname-options-fnWhat is the feature you are proposing to solve the problem?
Add
test.todosimilarly to howit.todocurrently exists:What alternatives have you considered?
Not doing it - we do have the
testtodooption so a shorthand is a QOL/DX improvement not a blocker of anything. I don't see the reason for whyitshould have it andtestnot though. Seems like parity on these would not hurt anything.