Angular 2 and Jasmine unit testing: cannot get the innerHtml
问题 I am using one of the examples that test a component 'WelcomeComponent': import { Component, OnInit } from '@angular/core'; import { UserService } from './model/user.service'; @Component({ selector: 'app-welcome', template: '<h3>{{welcome}}</h3>' }) export class WelcomeComponent implements OnInit { welcome = '-- not initialized yet --'; constructor(private userService: UserService) { } ngOnInit(): void { this.welcome = this.userService.isLoggedIn ? 'Welcome ' + this.userService.user.name :