Skip to content

Commit

Permalink
ci: Explicitly add DOM types
Browse files Browse the repository at this point in the history
CI for the `integration-test` project is currently failing with:

```console
Error: node_modules/@types/jsdom/base.d.ts(24,40): error TS2304: Cannot find name 'DocumentFragment'.
Error: node_modules/@types/jsdom/base.d.ts(41,28): error TS2304: Cannot find name 'Node'.
Error: node_modules/@types/jsdom/base.d.ts(172,19): error TS2304: Cannot find name 'HTMLScriptElement'.
Error: node_modules/@types/jsdom/base.d.ts(172,39): error TS2304: Cannot find name 'HTMLLinkElement'.
Error: node_modules/@types/jsdom/base.d.ts(172,57): error TS2304: Cannot find name 'HTMLIFrameElement'.
Error: node_modules/@types/jsdom/base.d.ts(172,77): error TS2304: Cannot find name 'HTMLImageElement'.
Error: node_modules/@types/jsdom/base.d.ts(181,38): error TS2304: Cannot find name 'Window'.
Error: node_modules/@types/jsdom/base.d.ts(185,24): error TS2304: Cannot find name 'Window'.
```

This suggests TypeScript cannot find types definitions for JsDOM. JsDom is a transitive dependency via Jest.

In this change we explicitly add the DOM types to tsconfig to solve this.

I don't fully understand why this has suddenly started happening.
I suspect our lack of a lockfile on the `integration-test` project might have something to do with it.

I also don't fully understand why we didn't see CI issues in #931 which bumped the version of TypeScript...

See: https://www.typescriptlang.org/tsconfig#high-level-libraries
  • Loading branch information
akash1810 committed Dec 1, 2021
1 parent 57d427b commit 4e809b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/integration-test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"target": "ES2020",
"module": "ES2020",
"moduleResolution": "node",
"lib": ["ES2020"],
"lib": ["ES2020", "DOM"],
"declaration": true,
"strict": true,
"noImplicitAny": true,
Expand Down

0 comments on commit 4e809b9

Please sign in to comment.