Angular 4 unit test - Cannot read property 'root' of undefined
问题 I've got a problem with my unit test. I don't know what's wrong with this test. I've searched a soulations but nothing works for me. When I want to mock Router I have an error TypeError: Cannot read property 'root' of undefined . Thanks in advace for any help. Error: TypeError: Cannot read property 'root' of undefined at rootRoute (webpack:///~/@angular/router/@angular/router.es5.js:5880:0 <- src/test.ts:53760:30) at DynamicTestModuleInjector.get (ng:///DynamicTestModule/module.ngfactory.js