我正在使用 toHaveBeenCalledWith
对 URL 进行测试,并且参数应该是不包含 null/
的部分。
expect(router.navigate).toHaveBeenCalledWith(jasmine.objectContaining(['/home']));
我尝试了上述的命令后,出现了以下错误:
Expected spy navigate to have been called with [ <jasmine.objectContaining([ '/home' ])> ] but actual calls were [ [ 'null/home' ] ].