Open jrgleason opened 1 year ago
I also tried using chat GPT, it came up with this...
import { mount } from '@vue/test-utils';
import App from "../src/App.vue";
import { expect, describe, it } from 'vitest';
import { Quasar } from 'quasar';
import { createLocalVue } from '@vue/test-utils';
import quasarPlugin from '@quasar/vite-plugin';
const localVue = createLocalVue()
localVue.use(Quasar, { plugins: [quasarPlugin] })
describe("Test App", ()=>{
it("Basic test", ()=>{
const wrapper = mount(App);
expect(wrapper.exists()).toBe(true);
})
})
But that throws
FAIL test/App.spec.mjs [ test/App.spec.mjs ]
TypeError: The URL must be of scheme file
❯ Object.openSync node:fs:583:10
❯ Object.readFileSync node:fs:459:35
❯ Object.<anonymous> node_modules/vite/dist/node-cjs/publicUtils.cjs:19:48
❯ Object.<anonymous> node_modules/vite/index.cjs:7:31
@jrgleason - I'm interested in knowing what you mean by "I also tried using chat GPT".
Ill jump into this today to try to reproduce, I had similiar issues with vitest. There should be a vitwst plugin somewhere. Have you tried that?
What happened?
Problem similar to that described here
I start out with this issue while using Vitetest...
The documentation referenced uses
@quasar/quasar-app-extension-testing-unit-jest
which has a bunch of npm audit issues so I can't use it. Next I try to just re-implement it per the other link...The lodash-es library does not seem to have any issues so I think I am good there. Then I am using it like this...
But that throws the log output below
What did you expect to happen?
I would expect to be able to run Vitest with Quasar
Reproduction URL
https://github.com/jrgleason/midas/tree/MORE_STUFF
How to reproduce?
npm ci
npm run test
Flavour
Vite Plugin (@quasar/vite-plugin)
Areas
App Extension API
Platforms/Browsers
Firefox, Chrome
Quasar info output
Additional context
No response