Skip to content

ReferenceError: document is not defined #990

@peterroe

Description

@peterroe

Describe the bug

demo online: https://stackblitz.com/edit/vitest-dev-vitest-gnawnk?file=vite.config.ts&initialPath=__vitest__

 FAIL  test/suite.test.ts > my vue component > should render
ReferenceError: document is not defined
 ❯ Proxy.mount node_modules/@vue/test-utils/dist/vue-test-utils.cjs.js:7757:14
 ❯ eval test/suite.test.ts:7:20
      5| describe('my vue component', () => {
      6|   it('should render', () => {
      7|     const wrapper = mount(MyComponent);
       |                    ^
      8|     expect(wrapper.html()).toMatchSnapshot();
      9|   });

Reproduction

No need.

System Info

No need.

Used Package Manager

pnpm

Validations

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