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

feat: add test to reproduce #605 #7

Merged
merged 4 commits into from
Feb 27, 2022

Conversation

jsjoeio
Copy link
Owner

@jsjoeio jsjoeio commented Feb 16, 2022

What:

This fixes a bug which assumes that tests don't run in SSR environments.

Why:

With frameworks like Next.js and Remix rendering components on the server, it's important that this library can mimic SSR environments as closely as possible.

How:

First by adding a test that reproduces the issue and then by moving this logic "into the hydrate function so we reference document when they want it to render for real." (suggested by mpeyper).

Checklist:

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

@codecov-commenter
Copy link

codecov-commenter commented Feb 16, 2022

Codecov Report

❗ No coverage uploaded for pull request base (jsjoeio-fix-ssr-before@0543a9e). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                    Coverage Diff                     @@
##             jsjoeio-fix-ssr-before        #7   +/-   ##
==========================================================
  Coverage                          ?   100.00%           
==========================================================
  Files                             ?        15           
  Lines                             ?       221           
  Branches                          ?        29           
==========================================================
  Hits                              ?       221           
  Misses                            ?         0           
  Partials                          ?         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 0543a9e...17b66df. Read the comment docs.

@jsjoeio jsjoeio marked this pull request as ready for review February 27, 2022 04:39
@jsjoeio jsjoeio merged commit 4fa9c80 into jsjoeio-fix-ssr-before Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants