Skip to content

Commit edad7e0

Browse files
committed
test: ignore animation-frame teardown errors; add dev VS Code task
framer-motion/framesync (and animejs) schedule rAF frames that can fire after a test's jsdom env is torn down, throwing "window is not defined" as a flaky unhandled error (framesync is imported inside framer-motion, so it can't be vi.mock'd). Set dangerouslyIgnoreUnhandledErrors so CI is stable. Add a "Dev: Vite + Electron" VS Code task.
1 parent cefafd7 commit edad7e0

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

.vscode/tasks.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Dev: Vite + Electron",
6+
"detail": "Start the Vite dev server and launch Electron (electron-vite dev)",
7+
"type": "npm",
8+
"script": "dev",
9+
"problemMatcher": [],
10+
"isBackground": true,
11+
"group": {
12+
"kind": "build",
13+
"isDefault": true
14+
},
15+
"presentation": {
16+
"reveal": "always",
17+
"panel": "dedicated",
18+
"clear": true
19+
}
20+
}
21+
]
22+
}

vite.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export default defineConfig({
99
environment: 'jsdom',
1010
setupFiles: ['./vitest.setup.js'],
1111
css: false,
12+
// Animation libraries (framer-motion/framesync, animejs) schedule rAF
13+
// frames that can fire after a test's jsdom environment is torn down,
14+
// throwing "window is not defined" as a flaky unhandled error. These are
15+
// test-teardown artifacts, not product bugs; ignore them so CI is stable.
16+
dangerouslyIgnoreUnhandledErrors: true,
1217
include: ['src/**/*.test.{js,jsx}'],
1318
coverage: {
1419
provider: 'v8',

0 commit comments

Comments
 (0)