Skip to content

ReferenceError: document is not defined var actContainerElement = document.createElement('div'); #14772

@joepuzzo

Description

@joepuzzo

React V 16.8

Im using jsdom and enzyme to unit test my lib. When i updated to V16.8 this morning I started getting the following. I think it has to do with the fact that test utils is a js IIFE, and the jsdom document object has not been created yet.

/Users/n0280500/Documents/Dev/ReactTools/informed/node_modules/react-dom/cjs/react-dom-test-utils.development.js:944
var actContainerElement = document.createElement('div');

ReferenceError: document is not defined

For more context: I have a setup file that gets executed before any of my enzyme tests as described by the docs https://airbnb.io/enzyme/docs/guides/jsdom.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions