Skip to content

Complex example from README.md file is not passing with jest + jsdom #725

Closed
@spamshaker

Description

@spamshaker
  • @testing-library/react version: 10.4.3
  • Testing Framework and version: Jest: 26.1.0
  • DOM Environment: jest-environment-jsdom, jsdom:16.2.2

Relevant code or config:

https://github.com/testing-library/react-testing-library/blob/master/README.md#complex-example

What you did:

  1. forked to https://github.com/spamshaker/dom-testing-library-template
  2. added two files base on example README.md#complex-example
    here (spamshaker/dom-testing-library-template@1ee1ff0)
  3. Got couple of errors which are fixed step by step in the pull request [react-testing-library] Fix for complex example running issue spamshaker/dom-testing-library-template#1

What happened:

Cannot run mentioned example with basic configuration + code contains some bugs which fails tests

Reproduction:

clone exact commit spamshaker/dom-testing-library-template@1ee1ff0
npm i
npm run test

Problem description:

This complex example is not passing in jest jsdom due to couple of issues

Suggested solution:

replace README.md#complex-example code by files from PR
https://github.com/spamshaker/dom-testing-library-template/pull/1/files
or include reference to repo that resolves those issues and allows to run and pass unit tests

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