Quasar integration with vitest #13997
Unanswered
prabhatsharma
asked this question in
General - Components / Directives / etc
Replies: 1 comment
-
I've been trying to test with vitest as well and I have done exactly what you are doing. It seems that it does not work with q-page components. Also I tried installing @quasar/quasar-app-extension-testing-unit-vitest. And at first glance it seems to work, but then I noticed an error:
So essentially my tests pass, but I can't use My tests look like this: import { installQuasar } from "@quasar/quasar-app-extension-testing-unit-vitest";
import { createPinia, setActivePinia } from "pinia";
import { describe, it, expect, beforeEach, afterEach } from "vitest";
import { mount } from "@vue/test-utils";
function lazyLoad(view: string) {
return () => import(view);
}
let SearchHome;
installQuasar();
beforeEach(async () => {
setActivePinia(createPinia());
});
describe("Search", () => {
it("search from premade query", async () => {
SearchHome = lazyLoad("../SearchHome.vue");
const wrapper = mount(SearchHome(), {});
expect(wrapper).toBeTruthy();
console.log(wrapper.html());
});
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been trying to implement unit testing with vitest but getting error
TypeError: Cannot read properties of undefined (reading 'header')
How can we get this to run?
my vite.config.ts
About.vue
About.test.ts
Error
The thread #12810 (comment) does not take me any further.
Beta Was this translation helpful? Give feedback.
All reactions