You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add test.todo to match it.todo in node:test #47897
In the Node test runner (https://nodejs.org/api/test.html#test-runner) we have describe.todo and it.todo to designate suites/tests which do not exist yet but we're planning on adding. The describe > it syntax is one option of declaring tests, though, there is also just test in the API. For those of us who prefer test over describe, there is no shorthand test.todo, only the test method todo option: https://nodejs.org/api/test.html#testname-options-fn
What is the feature you are proposing to solve the problem?
Add test.todo similarly to how it.todo currently exists:
namespaceit{// Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.functionskip(name?: string,options?: TestOptions,fn?: ItFn): void;functionskip(name?: string,fn?: ItFn): void;functionskip(options?: TestOptions,fn?: ItFn): void;functionskip(fn?: ItFn): void;// Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.functiontodo(name?: string,options?: TestOptions,fn?: ItFn): void;functiontodo(name?: string,fn?: ItFn): void;functiontodo(options?: TestOptions,fn?: ItFn): void;functiontodo(fn?: ItFn): void;}
What alternatives have you considered?
Not doing it - we do have the testtodo option so a shorthand is a QOL/DX improvement not a blocker of anything. I don't see the reason for why it should have it and test not though. Seems like parity on these would not hurt anything.
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.
I honestly just find it weird to have to import it for todo when I'm using test for everything else. Simple API is a great goal of course, but it seems like this parity between test and it would 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.
Activity
MoLow commentedon 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?
cjihrig commentedon May 7, 2023
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.
TomasHubelbauer commentedon May 7, 2023
I 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.cjihrig commentedon May 7, 2023
I didn't want to add that API for
it()either.test_runner: add shorthands to `test`
test_runner: add shorthands to `test`
test_runner: add shorthands to `test`
test_runner: add shorthands to `test`
ForbiddenEra commentedon Jul 19, 2023
Hopefully not too OT but .. should we have the same for
beforeandafter, IIRC I was only able to usebeforeEachandafterEachwithtest..?