Skip to content

deno test is not reading DOM types using test --config ./tsconfig.json #11470

@David-Else

Description

@David-Else

deno test --config ./tsconfig.json --watch --allow-all --no-check test/ (or without --no-check) returns:

error: Uncaught ReferenceError: document is not defined
const elem = document.getElementById("test") as HTMLElement;
             ^

tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"]
  }
}

main.ts

const elem = document.getElementById("test") as HTMLElement;

The LSP picks up my tsconfig.json fine and accepts document when use config = "./tsconfig.json", and test is reading the file as it says:

Unsupported compiler options in "/home/david/Documents/apps-sites/typeScript/dependency-heaven-
typescript/tsconfig.json".
  The following options were ignored:
    target

I have a test repo here to show the problem: https://github.com/David-Else/dependency-heaven-typescript

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions