-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot destructure property 'data' of 'e' as it is undefined #40
Comments
This is the same error, running a very simple test added to your demo folder inside the next branch: The component:
The test:
Maybe the solution to this error is creating a mock for the vue-announcer inside the component that is going to use it. Something like:
At least in the test inside the demo it works as:
|
The only way I can run the test mocking the package name is using something like:
because |
@felixzapata is it possible somehow to test methods from |
Maybe, It was not necessary for me but in other approaches, I did something similar. In the same test file:
Inside the suite:
|
Hi, just using vue-announcer (v3.1.5) in a component like:
const { assertive } = useAnnouncer();
(or polite etc) throws an error during the component test:If you only import the vue-announcer there will be no error.
The component is under a Vue 3 application using TypeScript, Composition API, and SFC (with
<script setup>
). The tests are with Vitest, also written in Typescript.The skeleton of my component test is:
The text was updated successfully, but these errors were encountered: