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

[jest-each] Add pretty format #6357

Merged
merged 8 commits into from
Jun 2, 2018
Merged

Conversation

mattphillips
Copy link
Contributor

@mattphillips mattphillips commented May 30, 2018

Summary

Use pretty format to interpolate test titles with given data.

Closes #6321

/cc @aaronabramov @SimenB

Do you guys think we need to trim serialising large datasets?

Test plan

  • Unit tests
  • e2e tests

Copy link
Contributor

@aaronabramov aaronabramov left a comment

Choose a reason for hiding this comment

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

that looks so dope! thanks for adding this feature! :)

${[{foo: {bar: 'baz'}}]} | ${[{foo: {bar: 'baz'}}]}
${Infinity} | ${Infinity}
${-Infinity} | ${-Infinity}
${NaN} | ${NaN}
Copy link
Contributor

Choose a reason for hiding this comment

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

this is so amazing! 😍

@SimenB
Copy link
Member

SimenB commented May 30, 2018

I've landed the CI fix PR, if you wanna rebase

@mattphillips
Copy link
Contributor Author

ping @SimenB fixed the conflicts 😄

@codecov-io
Copy link

codecov-io commented May 31, 2018

Codecov Report

Merging #6357 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6357      +/-   ##
==========================================
+ Coverage   63.47%   63.52%   +0.04%     
==========================================
  Files         227      227              
  Lines        8677     8688      +11     
  Branches        4        3       -1     
==========================================
+ Hits         5508     5519      +11     
  Misses       3168     3168              
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-each/src/bind.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aff9681...e416ebe. Read the comment docs.

@@ -240,6 +240,7 @@ Use `describe.each` if you keep duplicating the same test suites with different
- `%j` - JSON.
- `%o` - Object.
- `%%` - single percent sign ('%'). This does not consume an argument.
- `%p` - [pretty-format](https://www.npmjs.com/package/pretty-format).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should add it as a first option, so it's easily discoverable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thymikee done 😄

@github-actions
Copy link

This pull request 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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jest-each does not serialize values properly
7 participants