Skip to content

How to use hljsVuePlugin in unit test w/ vitest + @testing-library/vue ? #30

Closed
@smarlhens

Description

@smarlhens

Describe the bug

Hi there 👋🏻 ,

I'm currently using this plugin in my Vue 3 + vite + vitest + @testing-library/vue project and I'm facing an issue when trying to run my test:
image

I'm not sure if the error comes from your library, but maybe from my code or from my test implementation. If this is the case I apologize in advance.

Could you help me to solve this problem?

Reproduction

I've created a repo with one test case:

  • ❌ simple component using highlightjs component

I'm declaring hljsVuePlugin as a global.plugins follwing what I've understood from @vue/test-utils documentation but I do not know how to provide Vue instance 🤔

Repro repository : smarlhens/vue-vite-vitest-highlightjs-vue-plugin

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