You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-Make sure you have the latest vue cli which is 4.5.8 as of this writing.
-Run vue create example-app
-Select "Manually select features"
-Select Babel, Typescript, unit testing
-Select 3.x preview
-Select use class-style component syntax "yes"
-use Babel "yes"
-pick Jest for unit testing
Once the app is created, cd into the directory and run npm run test:unit.
The sample test fails with the following error:
console.warn node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:40
[Vue warn]: Property "msg" was accessed during render but is not defined on instance.
at <Anonymous msg="new message" ref="VTU_COMPONENT" >
at <VTUROOT>
What is expected?
The unit test should recognize the prop being passed to the HelloWorld.vue component.
What is actually happening?
It doesn't detect / take into account the prop provided inside the example.spec.ts file. It fails with this error:
console.warn node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:40
[Vue warn]: Property "msg" was accessed during render but is not defined on instance.
at <Anonymous msg="new message" ref="VTU_COMPONENT" >
at <VTUROOT>
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Version
3.0.2
Reproduction link
https://github.com/alperkay/vue-3-default-unit-test-error
Steps to reproduce
-Make sure you have the latest vue cli which is 4.5.8 as of this writing.
-Run
vue create example-app
-Select "Manually select features"
-Select Babel, Typescript, unit testing
-Select 3.x preview
-Select use class-style component syntax "yes"
-use Babel "yes"
-pick Jest for unit testing
Once the app is created, cd into the directory and run
npm run test:unit
.The sample test fails with the following error:
What is expected?
The unit test should recognize the prop being passed to the HelloWorld.vue component.
What is actually happening?
It doesn't detect / take into account the prop provided inside the example.spec.ts file. It fails with this error:
The text was updated successfully, but these errors were encountered: