Skip to content

In upgrading to 1.0.5, tests seem to be breaking due to missing globals of jsdom? #2342

Closed
@kellyrmilligan

Description

@kellyrmilligan

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Can you reproduce the problem with latest npm?

yes
Many errors, especially related to "missing modules", are due to npm bugs.

If you're using Windows, follow these instructions to update npm.

If you're using OS X or Linux, run this to update npm:

npm install -g npm@latest

cd your_project_directory
rm -rf node_modules
npm install

Then try to reproduce the issue again.

Can you still reproduce it?

Description

on upgrading to latest 1.0 release, a few tests are breaking that previously passed.

The first test that breaks throws an error on

document.getElementId call, getting TypeError: Cannot read property 'getElementById' of undefined shouldn't this be defined by jsdom?

second one is similar in nature, although it's calling it as a global without prefixing it with window.

i'm trying to track down the differences from the 0.9x stuff and 1.0. the rest of the tests I have are passing quite nicely.

Expected behavior

document should exist in the test env.

Actual behavior

Its not there.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts: [email protected]
  2. node -v: v6.9.2
  3. npm -v: 3.10.9

Then, specify:

  1. Operating system: OS X
  2. Browser and version:

Reproducible Demo

Please take the time to create a new app that reproduces the issue.

Alternatively, you could copy your app that experiences the problem and start removing things until you’re left with the minimal reproducible demo.

(Accidentally, you might get to the root of your problem during that process.)

Push to GitHub and paste the link here.

By doing this, you're helping the Create React App contributors a big time!
Demonstrable issues gets fixed faster.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions