Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement test.todo #2961

Merged
merged 8 commits into from May 21, 2023
Merged

Implement test.todo #2961

merged 8 commits into from May 21, 2023

Conversation

blackmann
Copy link
Contributor

Progress for #1825

test_files.len,
});
const total_tests = reporter.summary.fail + reporter.summary.pass + reporter.summary.skip + reporter.summary.todo;
Output.prettyError("Ran {d} tests across {d} files. <d>{d} total<r> ", .{ reporter.summary.fail + reporter.summary.pass, test_files.len, total_tests });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added total count

@paperdave
Copy link
Collaborator

this looks great. i love how nicely it formats in my terminal.

Can you add a feature to this that isn't specifically defined by jest?

test.todo("test", () => {
  apiThatIsBrokenOrNotImplemented()
})

This would have the semantics of "TODO: implement the code we are testing" instead of "TODO: implement this test".

and it will run this test and if it fails, it logs a todo notice like we already have. but if the test passes, it logs a test fail informing that the test has been implemented. so it's kind of like test.failing wit different logging.

this specific feature is something I've wanted for a while to use for our bundler tests, as we have many failing and skipped tests, when we are aware of their failure, but if any of them start passing, we want to know so we can add them to the list of expected passes.

@blackmann
Copy link
Contributor Author

blackmann commented May 20, 2023

image

This is the logs for different cases of .todo().

@paperdave

@paperdave
Copy link
Collaborator

looks awesome. i love it.

Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

thank you

@paperdave paperdave merged commit 0e97f91 into oven-sh:main May 21, 2023
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants