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

Replace print with serialize in HTMLElement plugin #4215

Merged
merged 2 commits into from
Aug 8, 2017

Conversation

pedrottimark
Copy link
Contributor

Summary

Support indentation and depth arguments. Enforce consistent printing of attributes/props.

After reading about Element.attributes and Node.childNodes Web API docs on MDN, I removed some conditional expressions that seemed to protect against absence of the properties.

Future follow up: To understand how much of whitespace trimming affects significant text content (see comments in test file) I will study some realistic examples, especially HTML rendered by React.

Test plan

Added 3 new fail-first tests.

@codecov-io
Copy link

Codecov Report

Merging #4215 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4215      +/-   ##
==========================================
- Coverage   60.19%   60.13%   -0.06%     
==========================================
  Files         191      191              
  Lines        6766     6756      -10     
  Branches        6        6              
==========================================
- Hits         4073     4063      -10     
  Misses       2690     2690              
  Partials        3        3
Impacted Files Coverage Δ
packages/pretty-format/src/plugins/html_element.js 100% <100%> (+5.88%) ⬆️
packages/pretty-format/src/index.js 96.18% <0%> (-1.53%) ⬇️
...ircus/src/legacy_code_todo_rewrite/jest_adapter.js 0% <0%> (ø) ⬆️
packages/jest-jasmine2/src/index.js 0% <0%> (ø) ⬆️

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 4523826...f295f97. Read the comment docs.

@cpojer cpojer merged commit 47a840b into jestjs:master Aug 8, 2017
@pedrottimark pedrottimark deleted the html-element-serialize branch August 8, 2017 15:48
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* Replace print with serialize in HTMLElement plugin

* Add comment about keysMapper and propsReducer
@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.

None yet

4 participants