Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tester happy-dom #5116

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
'<rootDir>/packages/utils-test/src/setup-test-env.ts',
'<rootDir>/packages/utils-test/src/setup-test-env-hooks.ts',
],
testEnvironment: 'jsdom',
testEnvironment: '@happy-dom/jest-environment',
testEnvironmentOptions: {
customExportConditions: ['node'],
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"@babel/preset-typescript": "7.23.0",
"@babel/register": "7.22.15",
"@commercetools/enzyme-extensions": "5.0.0",
"@happy-dom/jest-environment": "^12.9.1",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
"@sentry/cli": "2.21.1",
"@storybook/addon-actions": "7.4.5",
Expand Down
3 changes: 3 additions & 0 deletions setup/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ jest.spyOn(global.console, 'warn').mockImplementationOnce(message => {
throw new Error(message);
}
});

jest.spyOn(window.URL, 'createObjectURL').mockImplementation(() => 'http://fake.url');
global.open = jest.fn();
55 changes: 42 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4007,6 +4007,20 @@ __metadata:
languageName: unknown
linkType: soft

"@happy-dom/jest-environment@npm:^12.9.1":
version: 12.9.1
resolution: "@happy-dom/jest-environment@npm:12.9.1"
dependencies:
"@jest/environment": ^29.4.0
"@jest/fake-timers": ^29.4.0
"@jest/types": ^29.4.0
happy-dom: 12.9.1
jest-mock: ^29.4.0
jest-util: ^29.4.0
checksum: 4657912adff3f2d3413acb2449450e693742ae741dafd7ce90ba04b6de8b91556f158c59d49a8aa7358bf64a2b54862bff146f093354e9c4bc5c888298067f8c
languageName: node
linkType: hard

"@humanwhocodes/config-array@npm:^0.11.11":
version: 0.11.11
resolution: "@humanwhocodes/config-array@npm:0.11.11"
Expand Down Expand Up @@ -4128,7 +4142,7 @@ __metadata:
languageName: node
linkType: hard

"@jest/environment@npm:^29.7.0":
"@jest/environment@npm:^29.4.0, @jest/environment@npm:^29.7.0":
version: 29.7.0
resolution: "@jest/environment@npm:29.7.0"
dependencies:
Expand Down Expand Up @@ -4168,7 +4182,7 @@ __metadata:
languageName: node
linkType: hard

"@jest/fake-timers@npm:^29.7.0":
"@jest/fake-timers@npm:^29.4.0, @jest/fake-timers@npm:^29.7.0":
version: 29.7.0
resolution: "@jest/fake-timers@npm:29.7.0"
dependencies:
Expand Down Expand Up @@ -4321,7 +4335,7 @@ __metadata:
languageName: node
linkType: hard

"@jest/types@npm:^29.6.3":
"@jest/types@npm:^29.4.0, @jest/types@npm:^29.6.3":
version: 29.6.3
resolution: "@jest/types@npm:29.6.3"
dependencies:
Expand Down Expand Up @@ -13586,7 +13600,7 @@ __metadata:
languageName: node
linkType: hard

"entities@npm:^4.2.0, entities@npm:^4.4.0":
"entities@npm:^4.2.0, entities@npm:^4.4.0, entities@npm:^4.5.0":
version: 4.5.0
resolution: "entities@npm:4.5.0"
checksum: 853f8ebd5b425d350bffa97dd6958143179a5938352ccae092c62d1267c4e392a039be1bae7d51b6e4ffad25f51f9617531fedf5237f15df302ccfb452cbf2d7
Expand Down Expand Up @@ -15646,6 +15660,20 @@ __metadata:
languageName: node
linkType: hard

"happy-dom@npm:12.9.1":
version: 12.9.1
resolution: "happy-dom@npm:12.9.1"
dependencies:
css.escape: ^1.5.1
entities: ^4.5.0
iconv-lite: ^0.6.3
webidl-conversions: ^7.0.0
whatwg-encoding: ^2.0.0
whatwg-mimetype: ^3.0.0
checksum: 02e7f73199cda296ede1479559166ff1d2b04a4169679fa12d4b7c3b90caefc571c18ca6664bdeb1054b6d22465b2c10e78b3ddfc5676e87f7bd7b16b9afb00b
languageName: node
linkType: hard

"hard-rejection@npm:^2.1.0":
version: 2.1.0
resolution: "hard-rejection@npm:2.1.0"
Expand Down Expand Up @@ -17240,7 +17268,7 @@ __metadata:
languageName: node
linkType: hard

"jest-mock@npm:^29.7.0":
"jest-mock@npm:^29.4.0, jest-mock@npm:^29.7.0":
version: 29.7.0
resolution: "jest-mock@npm:29.7.0"
dependencies:
Expand Down Expand Up @@ -17406,31 +17434,31 @@ __metadata:
languageName: node
linkType: hard

"jest-util@npm:^29.6.3":
version: 29.6.3
resolution: "jest-util@npm:29.6.3"
"jest-util@npm:^29.4.0, jest-util@npm:^29.7.0":
version: 29.7.0
resolution: "jest-util@npm:29.7.0"
dependencies:
"@jest/types": ^29.6.3
"@types/node": "*"
chalk: ^4.0.0
ci-info: ^3.2.0
graceful-fs: ^4.2.9
picomatch: ^2.2.3
checksum: 7bf3ba3ac67ac6ceff7d8fdd23a86768e23ddd9133ecd9140ef87cc0c28708effabaf67a6cd45cd9d90a63d645a522ed0825d09ee59ac4c03b9c473b1fef4c7c
checksum: 042ab4980f4ccd4d50226e01e5c7376a8556b472442ca6091a8f102488c0f22e6e8b89ea874111d2328a2080083bf3225c86f3788c52af0bd0345a00eb57a3ca
languageName: node
linkType: hard

"jest-util@npm:^29.7.0":
version: 29.7.0
resolution: "jest-util@npm:29.7.0"
"jest-util@npm:^29.6.3":
version: 29.6.3
resolution: "jest-util@npm:29.6.3"
dependencies:
"@jest/types": ^29.6.3
"@types/node": "*"
chalk: ^4.0.0
ci-info: ^3.2.0
graceful-fs: ^4.2.9
picomatch: ^2.2.3
checksum: 042ab4980f4ccd4d50226e01e5c7376a8556b472442ca6091a8f102488c0f22e6e8b89ea874111d2328a2080083bf3225c86f3788c52af0bd0345a00eb57a3ca
checksum: 7bf3ba3ac67ac6ceff7d8fdd23a86768e23ddd9133ecd9140ef87cc0c28708effabaf67a6cd45cd9d90a63d645a522ed0825d09ee59ac4c03b9c473b1fef4c7c
languageName: node
linkType: hard

Expand Down Expand Up @@ -17862,6 +17890,7 @@ __metadata:
"@commercetools/enzyme-extensions": 5.0.0
"@formatjs/intl-datetimeformat": 6.10.3
"@formatjs/intl-numberformat": 8.7.2
"@happy-dom/jest-environment": ^12.9.1
"@navikt/aksel-icons": 5.6.1
"@navikt/ds-css": 5.6.1
"@navikt/ds-react": 5.6.1
Expand Down