Skip to content

Conversation

camelpunch
Copy link

This can happen in unit tests, especially when using Jest with jsdom.

You may get warnings like:

    Cannot log after tests are done. Did you forget to wait for something async in your test?
        Attempted to log "Error: Uncaught [TypeError: Cannot read property 'documentElement' of null]

If we check for the existence of the document first, we can tidy up our test output.

This can happen in unit tests, especially when using Jest with jsdom.

You may get warnings like:

    Cannot log after tests are done. Did you forget to wait for something async in your test?
        Attempted to log "Error: Uncaught [TypeError: Cannot read property 'documentElement' of null]

If we check for the existence of the document first, we can tidy up our
test output.
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.

1 participant