Closed rimijn closed 2 years ago
You're definitely doing something pretty messy in your project.
@quasar/app
and vue-cli-plugin-quasar
should never be used together: either you're using a Quasar CLI project (and have the former) or use Vue CLI (and have the latter)
That said, you're using the wrong @vue/cli-plugin-unit-jest
version. Vue3 and Qv2 need v5 (published on next
tag)
localVue
doesn't exist anymore, check out new VTU and Vue Jest docs
@IlCallo @quasar/app is not being used. We are using createApp and localVue is just the variable name. Also, when we create a fresh vue 3 project using vue cli and use vue add unit-jest, it installs this particular version(4.5.15) of vue-cli-plugin-unit-jest
Sorry, must have misread @quasar/extras
for @quasar/app
I'd say the problem is still the wrong Jest plugin, ask Vue CLI or the plugin maintainers about it, this doesn't seem to be related to Quasar in any way
Just out of curiosity, try adding an empty object as .use(Quasar, {})
and check out what happens
Application uses vue3 + ts + quasar v2 and jest for testing. Unit test are failing with error "Cannot convert undefined or null to object" at installQuasar when doing localVue.use(Quasar) or plugins: [Quasar] in test file. The config files are as mentioned below
package.json -
jest.config.js -
babel.config.js -
test file assets.spec.ts-
Error