Skip to content

Unit testing nested components - Child's emitted is undefined #819

Closed
@bugsduggan

Description

@bugsduggan

Version

1.0.0-beta.20

Reproduction link

https://github.com/bugsduggan/vue-test-utils-bug

Steps to reproduce

Clone the repo and run npm run test:unit. There will be one failing test indicating that the ChildComponent's emitted is undefined.

What is expected?

Having used mount instead of shallowMount, I was hoping to be able to see events that have been emitted by the ChildComponent.

What is actually happening?

ChildComponent's emitted function returns undefined.


I appreciate that this could be seen as testing the implementation of vue but I have 2 components that are very tightly coupled in my application and it is important for us to be able to check what events are being triggered by the child component while unit testing the parent.

If someone can help me narrow down the causes of this bug (and if it's not impossible or undesirable to fix), I would be happy to devote some hours into a pull request.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions