Skip to content

Commit

Permalink
Merge pull request #26 from yannbf/isolate-false
Browse files Browse the repository at this point in the history
Isolate false for node
  • Loading branch information
yannbf authored May 28, 2024
2 parents 4394a23 + 7c7f794 commit d5febf8
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 42 deletions.
13 changes: 13 additions & 0 deletions .yarn/patches/lottie-web-npm-5.12.2-942dc9e22a.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/build/player/lottie.js b/build/player/lottie.js
index cddf7ca82a09be4b846c83e3173ad65b874f72a9..e8f1676c31c81d01fff2b65c5db3aa71eb8525c3 100644
--- a/build/player/lottie.js
+++ b/build/player/lottie.js
@@ -5276,7 +5276,7 @@
lottie.version = '5.12.2';

function checkReady() {
- if (document.readyState === 'complete') {
+ if (typeof document !== 'undefined' && document.readyState === 'complete') {
clearInterval(readyStateCheckInterval);
searchAnimations();
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@
"react-is": "^18.3.1",
"react-test-renderer": "^18.3.1",
"storybook": "^8.1.2",
"vi-canvas-mock": "^1.0.0",
"vite": "^4.0.0",
"vite-plugin-inspect": "^0.8.4",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.6.0",
"vitest-axe": "^0.1.0",
"vitest-canvas-mock": "^0.3.3",
"wait-on": "^7.2.0",
"webdriverio": "^8.37.0"
},
Expand All @@ -163,6 +163,7 @@
},
"packageManager": "[email protected]",
"resolutions": {
"@use-it/event-listener@npm:^0.1.2": "patch:@use-it/event-listener@npm%3A0.1.7#~/.yarn/patches/@use-it-event-listener-npm-0.1.7-56ef42a654.patch"
"@use-it/event-listener@npm:^0.1.2": "patch:@use-it/event-listener@npm%3A0.1.7#~/.yarn/patches/@use-it-event-listener-npm-0.1.7-56ef42a654.patch",
"lottie-web@npm:^5.12.2": "patch:lottie-web@npm%3A5.12.2#~/.yarn/patches/lottie-web-npm-5.12.2-942dc9e22a.patch"
}
}
2 changes: 1 addition & 1 deletion src/setupTests.node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@testing-library/jest-dom/vitest'
import 'vitest-canvas-mock'
import 'vi-canvas-mock'
import { setProjectAnnotations } from '@storybook/react'
import * as axeMatchers from 'vitest-axe/matchers'
import { cleanup } from '@testing-library/react'
Expand Down
5 changes: 0 additions & 5 deletions test.browser.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ export default mergeConfig(
globals: true,
clearMocks: true,
isolate: true,
server: {
deps: {
inline: ['vitest-canvas-mock'],
},
},
browser: {
isolate: true,
enabled: true,
Expand Down
7 changes: 1 addition & 6 deletions test.node.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,10 @@ export default mergeConfig(
test: {
include,
exclude,
isolate: true,
globals: true,
clearMocks: true,
isolate: false,
setupFiles: './src/setupTests.node.ts',
server: {
deps: {
inline: ['vitest-canvas-mock'],
},
},
environment: 'happy-dom',
coverage: {
reporter: ['text', 'html'],
Expand Down
5 changes: 0 additions & 5 deletions vitest.vscode.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ export default mergeConfig(
globals: true,
clearMocks: true,
setupFiles: './src/setupTests.node.ts',
server: {
deps: {
inline: ['vitest-canvas-mock'],
},
},
environment: 'happy-dom',
coverage: {
provider: 'istanbul',
Expand Down
42 changes: 19 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8260,13 +8260,13 @@ __metadata:
styled-components: "npm:^5.3.3"
typescript: "npm:^5.4.5"
use-dark-mode: "npm:^2.3.1"
vi-canvas-mock: "npm:^1.0.0"
vite: "npm:^4.0.0"
vite-plugin-inspect: "npm:^0.8.4"
vite-plugin-svgr: "npm:^4.2.0"
vite-tsconfig-paths: "npm:^4.3.2"
vitest: "npm:^1.6.0"
vitest-axe: "npm:^0.1.0"
vitest-canvas-mock: "npm:^0.3.3"
wait-on: "npm:^7.2.0"
webdriverio: "npm:^8.37.0"
languageName: unknown
Expand Down Expand Up @@ -12457,16 +12457,6 @@ __metadata:
languageName: node
linkType: hard

"jest-canvas-mock@npm:~2.5.2":
version: 2.5.2
resolution: "jest-canvas-mock@npm:2.5.2"
dependencies:
cssfontparser: "npm:^1.2.1"
moo-color: "npm:^1.0.2"
checksum: 10/094e2e1c773c658fab7e91e9279027fc38a55060865b5b6a3c9acc47fc912fb9d3451ab4fdf544d016578f77b975626707c3a62e396575aa878f46d939c7ca5e
languageName: node
linkType: hard

"jest-changed-files@npm:^29.7.0":
version: 29.7.0
resolution: "jest-changed-files@npm:29.7.0"
Expand Down Expand Up @@ -13582,13 +13572,20 @@ __metadata:
languageName: node
linkType: hard

"lottie-web@npm:^5.12.2":
"lottie-web@npm:5.12.2":
version: 5.12.2
resolution: "lottie-web@npm:5.12.2"
checksum: 10/cd377d54a675b37ac9359306b84097ea402dff3d74a2f45e6e0dbcff1df94b3a978e92e48fd34765754bdbb94bd2d8d4da31954d95f156e77489596b235cac91
languageName: node
linkType: hard

"lottie-web@patch:lottie-web@npm%3A5.12.2#~/.yarn/patches/lottie-web-npm-5.12.2-942dc9e22a.patch":
version: 5.12.2
resolution: "lottie-web@patch:lottie-web@npm%3A5.12.2#~/.yarn/patches/lottie-web-npm-5.12.2-942dc9e22a.patch::version=5.12.2&hash=acc0ba"
checksum: 10/9a2579a57296ba474a56ebd14429f88ca12cb79db38c302c313ecb38cf4cd0e6ff2ac79228cb42ef42939933a22974699fa7b12c0e0ed4361303f9e5207371e7
languageName: node
linkType: hard

"loupe@npm:^2.3.6, loupe@npm:^2.3.7":
version: 2.3.7
resolution: "loupe@npm:2.3.7"
Expand Down Expand Up @@ -19121,6 +19118,16 @@ __metadata:
languageName: node
linkType: hard

"vi-canvas-mock@npm:^1.0.0":
version: 1.0.0
resolution: "vi-canvas-mock@npm:1.0.0"
dependencies:
cssfontparser: "npm:^1.2.1"
moo-color: "npm:^1.0.2"
checksum: 10/bfe9d79ce8a835407fe6abe2238ed4e6ba8faf847790d7c16e5c5ee5ffdf4dfcf66e17c6320635bb6033bfa35a47a3eaa870c57f466b51d10485bb8962922739
languageName: node
linkType: hard

"vite-node@npm:1.6.0":
version: 1.6.0
resolution: "vite-node@npm:1.6.0"
Expand Down Expand Up @@ -19335,17 +19342,6 @@ __metadata:
languageName: node
linkType: hard

"vitest-canvas-mock@npm:^0.3.3":
version: 0.3.3
resolution: "vitest-canvas-mock@npm:0.3.3"
dependencies:
jest-canvas-mock: "npm:~2.5.2"
peerDependencies:
vitest: "*"
checksum: 10/bf564fe0cb701f228eb20cacdbd3abb9eb83c948bebbbea7fe907082ef830b2f8d7865277eade77fd84806bd1ddccdf1426c85ad716b8da8a977ae6b82e4f85f
languageName: node
linkType: hard

"vitest@npm:^1.6.0":
version: 1.6.0
resolution: "vitest@npm:1.6.0"
Expand Down

0 comments on commit d5febf8

Please sign in to comment.