Skip to content
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

Sub-component is undefined #47

Closed
rndmerle opened this issue Sep 25, 2017 · 3 comments
Closed

Sub-component is undefined #47

rndmerle opened this issue Sep 25, 2017 · 3 comments

Comments

@rndmerle
Copy link

rndmerle commented Sep 25, 2017

Hi.

When mounting a component including a sub-component I get this error:

TypeError: Cannot convert undefined or null to object

      at node_modules/vue-test-utils/dist/vue-test-utils.js:117:33
          at Array.forEach (<anonymous>)
      at stubAllComponents (node_modules/vue-test-utils/dist/vue-test-utils.js:115:37)
      at shallow (node_modules/vue-test-utils/dist/vue-test-utils.js:991:5)

When stubbing, it happens the component is undefined.

I'm using vue-test-utils 0.1.0
The lib might be loaded by ts-jest.

I'm still investigating but maybe you've got an idea.

@rndmerle rndmerle changed the title Components undefined Sub-component is undefined Sep 25, 2017
@eddyerburgh
Copy link
Member

Hi, thanks for the issue.

I don't know what the problem is from the error message. Can you post a minimal reproduction?

@rndmerle
Copy link
Author

rndmerle commented Sep 25, 2017

Here is a reproduction:

git clone https://github.com/rndmerle/repro_vue-test-utils.git
cd repro_vue-test-utils
npm i
npm test

I guess the issue is that it's processed by Typescript, but in my project it's mandatory.
Thanks for your time.

@eddyerburgh
Copy link
Member

Thanks for the reproduction.

This is a jest-vue issue. I've made an issue over there, and released a fix. Can you on jest-vue that the release fixed your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants