最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

angular - You provided an invalid object where a stream was expected. You can provide an Observable, Promise, ReadableStream, Ar

programmeradmin8浏览0评论

I am trying to test the following code, but it seems that there is some dependency missing, something similar to rxjs, if anyone can identify I will be grateful

Test

    let paginatorMock: jest.Mocked<MatPaginator> = {
      pageIndex: 1,
      length: 1,
      pageSize: 10,
      page: {
        next: jest.fn() as any
      }
    } as unknown as jest.Mocked<MatPaginator>;

    fixture = TestBed.createComponent(ListarOperacoesComponent);
    component = fixtureponentInstance;
    fixture.detectChanges();
    component.dataSource.paginator = paginatorMock;
  });

Error

TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.
  152 |     component = fixtureponentInstance;
  153 |     fixture.detectChanges();
> 154 |     component.dataSource.paginator = paginatorMock;
      |                                   ^
  155 |   });
  156 |
  157 |   test('Funcao buscarOperacoes deve retornar Operacoes corretamente', () => {

 

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论