2 years ago

#66793

test-img

mike2611

Angular upgrade to 13 breaking unit tests - "Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node"

I recently upgraded our project's application version from 9 to 13 and as a part of it also upgraded few packages used including chromedriver, node, karma etc. Now we are using node v16 and angular v13 and karma v6.3.11.

I have karma.conf.js setup with concurrency 10 and I see that unit tests fail at following step with an error -

"Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node"

I calculate test coverage with browsers=ChromeHeadlessNoSandbox

afterAll(() => {
    document.body.removeChild(fixture.debugElement.nativeElement);
  }); 

I tried using "translate-no" on HTML and meta tags and also tried bypassing this statement if parent node doesn't exist but still this error is thrown. I am quite unsure what must be causing it. These errors are sporadic but quite regular and are not exactly same in count in every run and its causing difficulties in fixing the issue.

Note: These errors were observed in the past as well in older angular and node versions but were less frequent. Now with version upgrade, they are observed every time

node.js

angular

karma-coverage

0 Answers

Your Answer

Accepted video resources