chaance / vitest-dom

Custom Vitest matchers to test the state of the DOM, forked from jest-dom.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation update for loading types

agmcleod opened this issue · comments

Hello, using sveltekit & typescript 5, I was running into errors in VSCode with it detecting expect test and toBeInTheDocument as valid types. I did setup vitest-setup.ts to import import 'vitest-dom/extend-expect'. However I needed to do the other mentioned steps as well, and add the following into my tsconfig:

"compilerOptions": {
  // ...
  "types": ["vitest/globals", "vitest-dom/extend-expect"]
}

Maybe im doing something wrong in my setup where just the import didnt work, but figure I'd submit an issue :)