Skip to content
Open
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: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@testing-library/react": "^14.1.0",
"@testing-library/vue": "8.1.0",
"@types/jsdom": "^21.1.5",
"@types/jsdom-global": "^3.0.7",
"@types/mdx": "^2.0.10",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
Expand All @@ -67,6 +68,7 @@
"esbuild": "^0.19.5",
"hono": "4.6.14",
"jsdom": "^22.1.0",
"jsdom-global": "^3.0.2",
"kcd-scripts": "^14.0.1",
"left-pad": "^1.3.0",
"mdx-test-data": "^1.0.1",
Expand Down
7 changes: 2 additions & 5 deletions src/__tests__/setup-tests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import jsdomPkg from 'jsdom'
import jsdomGlobal from 'jsdom-global';
jsdomGlobal();
process.env.NODE_ENV = 'test'

const {JSDOM} = jsdomPkg
Expand All @@ -16,11 +18,6 @@ function copyProps(src, target) {
})
}

// @ts-expect-error TS2322 🤷‍♂️
global.window = window
global.document = window.document
// @ts-expect-error TS2740 🤷‍♂️
global.navigator = {userAgent: 'node.js'}
global.requestAnimationFrame = callback => setTimeout(callback, 0)
global.cancelAnimationFrame = id => clearTimeout(id)
copyProps(window, global)
Loading