Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFlashAccount committed Dec 22, 2024
1 parent 553967c commit c7b2470
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
},
"//": [
"--max-old-space-size=4096 is required when sourcemaps are enabled,",
"otherwise Rollup runs out of memory when Vite is rendering chunks."
"otherwise Rollup runs out of memory when Vite is rendering chunks.",
"ResizeObserver is required for the dashboard tests to work.",
"ResizeObserver is not supported in vitest, so we need to stub it."
],
"scripts": {
"typecheck": "vue-tsc --noEmit -p tsconfig.app.json",
Expand Down Expand Up @@ -217,7 +219,8 @@
"vue-react-wrapper": "^0.3.1",
"vue-tsc": "^2.0.24",
"yaml": "^2.4.5",
"ydoc-server": "workspace:*"
"ydoc-server": "workspace:*",
"resize-observer-polyfill": "1.5.1"
},
"overrides": {
"@aws-amplify/auth": "../_IGNORED_",
Expand Down
4 changes: 4 additions & 0 deletions app/gui/src/dashboard/test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
* @file Global setup for dashboard tests.
*/

import { vi } from 'vitest'
import * as matchers from '@testing-library/jest-dom/matchers'
import { cleanup } from '@testing-library/react'
import { MotionGlobalConfig } from 'framer-motion'
import ResizeObserver from 'resize-observer-polyfill'
import { afterEach, expect } from 'vitest'

vi.stubGlobal('ResizeObserver', ResizeObserver)

MotionGlobalConfig.skipAnimations = true

expect.extend(matchers)
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit c7b2470

Please sign in to comment.