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

Fix snapshot serializer require, restructure pretty-format. #3399

Merged
merged 2 commits into from
Apr 28, 2017

Conversation

cpojer
Copy link
Member

@cpojer cpojer commented Apr 28, 2017

Summary

Fixes #3284 by not bypassing the user defined transform pipeline.

This also enables proper typing for pretty-format plugins within the Jest repo and stops reaching into build files, which Jest should never do, by exporting the plugins directly.

Test plan

jest

@codecov-io
Copy link

codecov-io commented Apr 28, 2017

Codecov Report

Merging #3399 into master will decrease coverage by 0.1%.
The diff coverage is 70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3399      +/-   ##
==========================================
- Coverage   64.27%   64.16%   -0.11%     
==========================================
  Files         176      176              
  Lines        6538     6530       -8     
  Branches        4        4              
==========================================
- Hits         4202     4190      -12     
- Misses       2335     2339       +4     
  Partials        1        1
Impacted Files Coverage Δ
...es/pretty-format/src/plugins/lib/printImmutable.js 100% <ø> (ø) ⬆️
...es/pretty-format/src/plugins/ReactTestComponent.js 100% <ø> (ø) ⬆️
...ges/pretty-format/src/plugins/AsymmetricMatcher.js 100% <ø> (ø) ⬆️
packages/pretty-format/src/plugins/ConvertAnsi.js 100% <ø> (ø) ⬆️
...s/pretty-format/src/plugins/ImmutableOrderedSet.js 100% <ø> (ø) ⬆️
packages/pretty-format/src/plugins/ImmutableSet.js 100% <ø> (ø) ⬆️
...ckages/pretty-format/src/plugins/ImmutableStack.js 100% <ø> (ø) ⬆️
packages/pretty-format/src/plugins/HTMLElement.js 96.66% <ø> (ø) ⬆️
...ackages/pretty-format/src/plugins/ImmutableList.js 100% <ø> (ø) ⬆️
packages/pretty-format/src/plugins/ImmutableMap.js 100% <ø> (ø) ⬆️
... and 8 more

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 33dceab...21622c3. Read the comment docs.

@cpojer cpojer force-pushed the master branch 2 times, most recently from 036586d to 413b752 Compare April 28, 2017 01:28
Copy link
Contributor

@Daniel15 Daniel15 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

module.exports = {
process(src, filename, config, options) {
if (/bar.js$/.test(filename)) {
return `${src};\module.exports = createPlugin('bar');`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the backslash (\) is a little confusing here at the first look. Can we remove it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! That was a bug.

@cpojer cpojer merged commit 53bea61 into jestjs:master Apr 28, 2017
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
)

* Fix snapshot serializer require, restructure pretty-format.

* Add a test.
@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 13, 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.

Transforms are not ran on snapshotSerializers
5 participants