尝试运行ng测试时出错:应创建FAILED

时间:2020-09-23 12:52:50

标签: angular testing jasmine karma-jasmine

错误:无法将@Input装饰器与查询装饰器组合

我的规格文件(未做任何更改):

describe('LoginComponent', () => {
  let component: LoginComponent;
  let fixture: ComponentFixture<LoginComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ LoginComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(LoginComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

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

组件文件(完全为空):

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss']
})
export class LoginComponent  {

}

0 个答案:

没有答案
相关问题