question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Regression][v9] adding stubs to child components causes child component "@Output" removal

See original GitHub issue

After upgrading to version 9 of shallow-render and Angular, using shallow.mock() to add child component instance properties causes @Output fooChange not initialized in 'MockOfFooComponent' error. Without calling shallow.mock() component is initialized correctly with child component outputs.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
hakimiocommented, Apr 17, 2020

Ok, I’ll make a PR with a fix and a unit test soon. Thank you very much for making this awesome library 😃

0reactions
hakimiocommented, Apr 17, 2020

Yes, it’s working well now. Thanks for fixing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does removing and newly adding a child component ...
When the criterias in the parent component change and the list of items is loaded again, the child component fails with this error...
Read more >
Mock method in stubbed child component · Issue #1570 - GitHub
Problem. I have a ParentComponent which fires a method on a ChildComponent by using the $refs property. However, in testing when I shallowMount ......
Read more >
Towards Better Testing In Angular. Part 1 — Mocking Child ...
Add the child component to declarations array; Use NO_ERRORS_SCHEMA to ignore the child component; Manually mock/stub the child component ...
Read more >
Testing Components with children - Testing Angular
An integration test of HomeComponent renders the child Components. The host elements are filled with the output of CounterComponent ...
Read more >
Sharing data between child and parent directives ... - Angular
A common pattern in Angular is sharing data between a parent component and one or more child components. Implement this pattern with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found