admin 管理员组

文章数量: 1087139

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', () => {

 

本文标签:

Error[2]: Invalid argument supplied for foreach(), File: /www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm, Line: 58
File: /www/wwwroot/roclinux.cn/tmp/route_read.php, Line: 205, include(/www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm)
File: /www/wwwroot/roclinux.cn/tmp/index.inc.php, Line: 129, include(/www/wwwroot/roclinux.cn/tmp/route_read.php)
File: /www/wwwroot/roclinux.cn/index.php, Line: 29, include(/www/wwwroot/roclinux.cn/tmp/index.inc.php)