Trying to mock Renderer2 in a Jest environment and can't make it working. Jest 23 & Angular 7. Tried everythig what goes from:
- https://github.com/angular/angular/issues/15341
- Make the component test to have a body or mock Renderer2
component.ts
const icosahedron = document.getElementById('renderIcosahedron');
this.renderer2.appendChild(icosahedron, this.renderer.domElement);
Getting all the time the error (only in tests):
TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
Edit: more detailed explanation has been added to the Angular's repo, however it was rejected as a bug. Link: https://github.com/angular/angular/issues/30865#issue-452458779