首页 > 解决方案 > 失败:无法读取未定义的属性“querySelector” - 业力茉莉

问题描述

我尝试使用业力和茉莉花来测试我的角度组件,在这里我收到错误“失败:无法读取未定义的属性'querySelector'”。

这是我的测试用例:这里我的目的是验证两个特定字段是否有输入的按钮。

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

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

标签: javascriptangularunit-testingkarma-jasmine

解决方案


推荐阅读