admin管理员组文章数量:1026989
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', () => {
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', () => {
本文标签:
版权声明:本文标题:angular - You provided an invalid object where a stream was expected. You can provide an Observable, Promise, ReadableStream, Ar 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1738226072a1556010.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论