'Angular 'should create' unit-test fails with error 'TypeError: Cannot read properties of undefined (reading 'parent')'

First basic unit test of each component:

it('should create', () => {
  expect(component).toBeTruthy();
});

fails with error:

TypeError: Cannot read properties of undefined (reading 'parent')
at componentName.routerSubscribe

I assume that solution is pretty obvious but can't find the answer



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source