Skip to content

Commit

Permalink
chore: remove unnecessary mutationobserver-shim
Browse files Browse the repository at this point in the history
jsdom 13.2.0 added direct support for MutationObserver, and recommends
removing all workarounds. We're on version 19.0.

Refs: jsdom/jsdom#639 (comment)

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
  • Loading branch information
miketheman committed Oct 18, 2022
1 parent edd5d97 commit 6f8adbd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
13 changes: 0 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"jest": "28.1.0",
"jest-environment-jsdom": "^28.1.0",
"jest-fetch-mock": "2.1.2",
"mutationobserver-shim": "0.3.3",
"sass-lint": "1.13.1"
},
"eslintConfig": {
Expand Down
20 changes: 0 additions & 20 deletions tests/frontend/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@
* limitations under the License.
*/

// Setup MutationObserver shim since jsdom doesn't
// support it out of the box.

const fs = require("fs");
const path = require("path");

const shim = fs.readFileSync(
path.resolve(
"node_modules",
"mutationobserver-shim",
"dist",
"mutationobserver.min.js"
),
{ encoding: "utf-8" }
);
const script = window.document.createElement("script");
script.textContent = shim;

window.document.body.appendChild(script);

// Extend Jest with jest-dom https://github.com/testing-library/jest-dom
import "@testing-library/jest-dom/extend-expect";

Expand Down

0 comments on commit 6f8adbd

Please sign in to comment.