Skip to content

Commit

Permalink
Add Jest Env JSDOM Sixteen to Fix MutationObserver
Browse files Browse the repository at this point in the history
Add `jest-environment-jsdom-sixteen` as Testing Library has to remove
MutationObserver shim since the significant browsers and recent version
of JSDOM support MutationObserver, so there is no need for Testing
Library have their version of MutationObserver. However, `react-scripts`
have not updated to account for the loss of MutationObserver. As a
result, we add in manually until `react-scripts` has updated.

---
Ref:

testing-library/dom-testing-library#477
https://github.com/testing-library/dom-testing-library/releases/tag/v7.0.0
  • Loading branch information
SpiritBreaker226 committed Oct 16, 2020
1 parent 9e3cfff commit a7b193e
Show file tree
Hide file tree
Showing 2 changed files with 291 additions and 9 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --watchAll=false",
"test:watch": "react-scripts test",
"test": "react-scripts test --watchAll=false --env=jest-environment-jsdom-sixteen",
"test:watch": "react-scripts test --env=jest-environment-jsdom-sixteen",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand All @@ -42,5 +42,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"jest-environment-jsdom-sixteen": "^1.0.3"
}
}
Loading

0 comments on commit a7b193e

Please sign in to comment.