Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
uki00a committed Sep 1, 2024
1 parent 8371bbf commit a11ed80
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .deno-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.45.2
2.0.0-rc.0
7 changes: 7 additions & 0 deletions components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ function setupDOMEnvironmentOnce(): void {

function setupDocument(): void {
globalThis.document = createDocument();
if (globalThis.window == null) {
// NOTE: `window` will be removed in Deno v2
// See: https://github.com/testing-library/dom-testing-library/blob/v8.20.0/src/helpers.ts#L20-L26
// TODO: Find a better solution
// @ts-expect-error This is intended
globalThis.window = globalThis;
}
}

function setupUserEvent(): void {
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"🔧/": "./demo/services/",
"$fresh-testing-library": "./mod.ts",
"$fresh-testing-library/": "./",
"$gfm": "https://deno.land/x/gfm@0.2.5/mod.ts",
"$gfm": "jsr:@deno/gfm@0.9.0",
"msw": "npm:[email protected]"
},
"compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" },
Expand Down

0 comments on commit a11ed80

Please sign in to comment.