Add support to jest-emotion for printing DOM Elements (#619)#622
Merged
Conversation
Codecov Report
|
emmatown
reviewed
Apr 13, 2018
| ) | ||
| ``` | ||
|
|
||
| ### `disableDOMElements` |
Member
There was a problem hiding this comment.
Could you rename this option to DOMElements and make it so that it's true by default and making it false disables printing DOM elements' styles.
Contributor
Author
There was a problem hiding this comment.
oops! I forgot to update README.md accordingly. Done now.
| describe('jest-emotion with dom elements', () => { | ||
| const emotionPlugin = createSerializer(emotion) | ||
|
|
||
| const divStyle = emotion.css(` |
Member
There was a problem hiding this comment.
Could you change this to use css as a tagged template literal like this?
css`
color: red;
`* use tagged template literals with `css` * reverse the configuration logic for DOM elements and have it enable by default
Member
|
Thank you @rszewczyk! |
|
This is awesome! Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Modifies the snapshot serializer plugin to:
Why:
This will allow
jest-emotionto work with libraries likereact-testing-libraryHow:
jest/pretty-formatdom element pluginThe test I wrote for this uses
pretty-formatdirectly in order to isolate them from the serializer used to test the rest of the packages.Checklist: