Skip to content

Fails without an error message  #318

Closed
@crshmk

Description

@crshmk
  • react-testing-library version: 6.0.0
  • react version: 16.8.3
  • node version: 10.13.0
  • npm (or yarn) version: 6.4.1

If package.json contains
"^react": "<rootDir>/node_modules/react"
here:

  "jest": {
    "moduleNameMapper": {
      "^react": "<rootDir>/node_modules/react",
    }

then imports from react-testing-library as

import { render } from 'react-testing-library'

will be undefined. No error message will clue the problem. Debugging this problem takes a long time.

I don't know why this line of config was in this project and it doesn't seem needed now, yet some sort of error message would have saved hours of debugging. I imagine this or some other conflicting config was the issue here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions