I encountered an issue while running 'ng test' on my Angular 6 application:
Error: Unable to access property 'textContent' of null
To view a sample of the application, please check out: SampleApp
The problem seems to be originating from the app.component.spec.ts file. Refer to the error message below:
AppComponentTest - should display title in a h1 tag
Failed: Cannot read property 'textContent' of null
at <Jasmine>
at UserContext.eval (./src/app/app.component.spec.ts?:31:44)
at ZoneDelegate.invoke (./node_modules/zone.js/dist/zone.js?:387:26)
at AsyncTestZoneSpec.onInvoke (./node_modules/zone.js/dist/zone-testing.js?:712:39)
at ProxyZoneSpec.onInvoke (./node_modules/zone.js/dist/zone-testing.js?:284:39)
at ZoneDelegate.invoke (./node_modules/zone.js/dist/zone.js?:386:32)
at Zone.runGuarded (./node_modules/zone.js/dist/zone.js?:150:47)
at runInTestZone (./node_modules/zone.js/dist/zone-testing.js?:840:29)
at UserContext.eval (./node_modules/zone.js/dist/zone-testing.js?:774:17)
at ZoneDelegate.invoke (./node_modules/zone.js/dist/zone.js?:387:26)
at ProxyZoneSpec.onInvoke (./node_modules/zone.js/dist/zone-testing.js?:287:39)