Skip to content

Conversation

alexkrolick
Copy link
Collaborator

@alexkrolick alexkrolick commented Oct 15, 2018

Fixes an unsafe reference that can throw an error in debugDOM when it receives a reference to a document in a real browser (ie puppeteer/codepen)

What:

Why:

How:

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

kentcdodds
kentcdodds previously approved these changes Oct 15, 2018
Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

👍

@kentcdodds
Copy link
Member

We'll need a test to cover this case :)

@alexkrolick
Copy link
Collaborator Author

alexkrolick commented Oct 15, 2018

repro: https://codepen.io/anon/pen/bmYmPd?editors=0011


EDIT: the test fails as expected if you render into document.body and bind the queries to the document object instead of a fresh div

@codecov
Copy link

codecov bot commented Oct 15, 2018

Codecov Report

Merging #129 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #129   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          11     11           
  Lines         211    211           
  Branches       53     54    +1     
=====================================
  Hits          211    211
Impacted Files Coverage Δ
src/query-helpers.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 fe08240...0896ee7. Read the comment docs.

@alexkrolick
Copy link
Collaborator Author

@kentcdodds added test

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Cool, thanks!

@kentcdodds kentcdodds merged commit f5184ce into master Oct 16, 2018
@kentcdodds kentcdodds deleted the fix-window-ref branch October 16, 2018 05:07
@kentcdodds
Copy link
Member

🎉 This PR is included in version 3.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants