The release notes for Jest 24 highlighted a new feature that I want to make use of: test.todo
. However, for the life of my I am unable to use it.
For example, I want to sketch out tests in my subscriptions.test.ts
file so I create the following:
describe('Subscription Tests', () => {
test.todo('... a name');
});
The TypeScript compiler then promptly presents me with a red line under todo
saying, Property 'todo' does not exist on type 'It'.
I am sure I am missing something obvious but I've hit the wall at this point. Can someone help?
Thanks to the comment from @jonrsharpe I ran yarn upgrade @types/jest --latest
and that resolved my problem. Urgh -- could not see the wood for the trees!
I feel pretty dumb for a while because my test was failing after adding the todo()
. I shoud've read the documentation more thoroughly. Here is my problematic code:
test("should show progress indicator when authorizing", () => {
test.todo("should show progress indicator when authorizing")
})
But it need to be like the below. Passing callback when using todo
and nested test()
in the callback are not allowed.
test.todo("should show progress indicator when authorizing")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With