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
I'd really like to be able to create tests via it without a callback function. These tests should be automatically marked as skipped.
Motivation
When I'm writing a test suite for a complicated object, I like to be able to write all of the tests I want to cover first, and then go back and implement them one by one. This helps me to think about my module at a high level without getting bogged down in the details.
I run Jest in a tab with the --watch flag turned on. It's really handy to be able to write this out first, and then have Jest ticking down the tests I still need to write. I could add skip calls all over the place, but that slows me down when implementing them.
Example
For example, if I were writing a test file for a safelyParseDate function, I might do something like this:
describe("safelyParseDate",()=>{describe("when the value is an ISO string",()=>{it("parses the date");});describe("when the value is not an ISO string",()=>{it("returns the string unmodified");});describe("when the value is undefined",()=>{it("returns undefined");});describe("when the value is null",()=>{it("returns null");});describe("when the value is already a date",()=>{it("returns the date");});});
Pitch
This behavior is implemented in Mocha, Rspec and other test runners as well. I think it's a good test workflow, and it encourages developers to be thorough and get all of their test cases written down.
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🚀 Feature Proposal
I'd really like to be able to create tests via
it
without a callback function. These tests should be automatically marked as skipped.Motivation
When I'm writing a test suite for a complicated object, I like to be able to write all of the tests I want to cover first, and then go back and implement them one by one. This helps me to think about my module at a high level without getting bogged down in the details.
I run Jest in a tab with the
--watch
flag turned on. It's really handy to be able to write this out first, and then have Jest ticking down the tests I still need to write. I could addskip
calls all over the place, but that slows me down when implementing them.Example
For example, if I were writing a test file for a
safelyParseDate
function, I might do something like this:Pitch
This behavior is implemented in Mocha, Rspec and other test runners as well. I think it's a good test workflow, and it encourages developers to be thorough and get all of their test cases written down.
The text was updated successfully, but these errors were encountered: