Skip to content

Commit

Permalink
Replace jest-environment-jsdom with jest-fixed-jsdom
Browse files Browse the repository at this point in the history
And remove custom polyfills and whatwg-fetch.
Hopefully this would be a more stable testing environment.
  • Loading branch information
davelopez committed Aug 8, 2024
1 parent de92eff commit cbf719c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 39 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
"imports-loader": "^4.0.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fixed-jsdom": "^0.0.2",
"jest-location-mock": "^2.0.0",
"jsdom-worker": "^0.3.0",
"json-loader": "^0.5.7",
Expand All @@ -202,7 +203,6 @@
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0",
"whatwg-fetch": "^3.6.20",
"xml-js": "^1.6.11",
"yaml-jest": "^1.2.0",
"yaml-loader": "^0.8.0"
Expand Down
2 changes: 1 addition & 1 deletion client/tests/jest/jest-environment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "jsdom-worker";

import JSDOMEnvironment from "jest-environment-jsdom";
import JSDOMEnvironment from "jest-fixed-jsdom";

class MockObserver {
constructor(...args) {}
Expand Down
1 change: 0 additions & 1 deletion client/tests/jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ module.exports = {
modulePathIgnorePatterns: ["<rootDir>/src/.*/__mocks__"],
rootDir: path.join(__dirname, "../../"),
roots: ["<rootDir>/src/", "<rootDir>/tests/jest/standalone/"],
setupFiles: ["<rootDir>/tests/jest/jest.polyfills.js"],
setupFilesAfterEnv: ["<rootDir>/tests/jest/jest.setup.js"],
testEnvironment: "<rootDir>/tests/jest/jest-environment.js",
testEnvironmentOptions: {
Expand Down
30 changes: 0 additions & 30 deletions client/tests/jest/jest.polyfills.js

This file was deleted.

1 change: 0 additions & 1 deletion client/tests/jest/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "@testing-library/jest-dom";
import "@testing-library/jest-dom/jest-globals";
import "whatwg-fetch";
import "fake-indexeddb/auto";

import Vue from "vue";
Expand Down
10 changes: 5 additions & 5 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7853,6 +7853,11 @@ jest-environment-node@^29.7.0:
jest-mock "^29.7.0"
jest-util "^29.7.0"

jest-fixed-jsdom@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/jest-fixed-jsdom/-/jest-fixed-jsdom-0.0.2.tgz#2a15d2db64cf9276afd162c451ae727b89a8811e"
integrity sha512-rQ7tcI7Sz3XGxEzk7Ic/4n3y83O0cGnSK3lFU3lqHhYaxp/00yoolBBOTnY6bLKkI1XzO4EMgyHYZ1IBRpEesw==

jest-get-type@^29.6.3:
version "29.6.3"
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1"
Expand Down Expand Up @@ -12380,11 +12385,6 @@ whatwg-encoding@^2.0.0:
dependencies:
iconv-lite "0.6.3"

whatwg-fetch@^3.6.20:
version "3.6.20"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz#580ce6d791facec91d37c72890995a0b48d31c70"
integrity sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==

whatwg-mimetype@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7"
Expand Down

0 comments on commit cbf719c

Please sign in to comment.