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

Provide plugins to pretty-format in jest-each #7805

Closed
billyjanitsch opened this issue Feb 5, 2019 · 4 comments
Closed

Provide plugins to pretty-format in jest-each #7805

billyjanitsch opened this issue Feb 5, 2019 · 4 comments

Comments

@billyjanitsch
Copy link

🚀 Feature Proposal

Provide a default set of plugins to jest-each's use of pretty-format.

Motivation

jest-snapshot provides a default set of plugins to pretty-format, which are used during formatting of expect().toMatchSnapshot().

jest-each also uses pretty-format to format programmatic test titles (added in #6357), but does not provide any plugins to pretty-format. So, for example, something like this doesn't work:

test.each([
  <Button />,
  <Button active />,
])('renders %p', element => {
  // ... test goes here
})

Because pretty-format isn't invoked with the ReactElement plugin.

It would be nice if it was invoked with the same set of default plugins as in jest-snapshot.

Example

See above.

Pitch

Why does this feature belong in the Jest core platform?

For consistency between jest-snapshot and jest-each.

@tonyhallett
Copy link

+1 Would like to be able to point to a property on my table row and use it for the test description. The only way I think I can do this is override toString and use %s

@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 25, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions
Copy link

github-actions bot commented May 2, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants