Skip to content

How to use @vscode-elements/react-elements with Vitest (jsdom)? #19

Description

@dankeboy36

Hello, I’m trying to test a minimal React component that imports from @vscode-elements/react-elements using vitest ( and jsdom), but Vitest fails on a transitive import from @vscode-elements/elements:

Cannot find module '../includes/VscElement' imported from .../elements/dist/vscode-tree/vscode-tree.js

Repro: https://github.com/dankeboy36/vscode-react-elements-vitest-example

Is there a recommended Vitest/jsdom setup for these components?

I confirm that if I fully mock all VS Code elements, it works, but I prefer testing my app with the actual VS Code UI. Am I doing this wrong? Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions