Angular测试开关示意调用呼叫0次
在我的Angular组件中,我有此代码: delete(post: PostInterface): void { const delete$ = this.appDataService.proxy .delete(post, this.paginate)…
在Angular 13升级后,茉莉单元测试失败 - 预期的一个匹配请求“匹配方法:post,url:api/x/x search”,找到无
从12个升级到Angular 13后,一些单元测试开始失败: 错误:预期的一个标准匹配请求“匹配方法:post,url:api/x/x-search”,没有发现。 这是模拟 as…
在Requier.context test.ts中仅设置一个单元测试
我试图在所需的上下文中设置一个单个规格: const context = require.context('./', true, /my-element.component\.spec\.ts$/); 但是它在该路径中找…
茉莉AG网格测试案例失败
我正在尝试编写用于Ag网格导出方法的测试。 这是组件更改 export class GridComponent extendsimplements OnInit { gridApi: any; onGridDataExport()…
Angular单元测试错误:可以解析ExtConfig的所有参数:(?,?)
我是角度单位测试的新手。运行 ng Test 命令时,该单元测试失败了: Can't resolve all parameters for ExtConfig: (?, ?) 如何解决此错误? download…
无法读取未定义的属性(阅读' subscribe')在Ngoninit中使用单位测试
当前面对单元测试errror: AppComponent > should call app TypeError: Cannot read properties of undefined (reading 'subscribe') 在我的ngoninit…
Angular单元测试窗口。打开找不到文档
在我的代码库中,我正在调用窗口。然后在调用document.write函数之后,如下所示。 public launch() { const previewWindow = window.open(''); previe…
角度排除外部JavaScript库中的单位测试
我正在使用使用外部JavaScript库的组件来测试我的组件,如果我评论行 aksservice = aksserviceFactory(),我的所有测试用例都可以在我的组件中导入…
茉莉单元测试 - TypeError:无法读取未定义的属性(读取' pipe')
typeError:无法在mycomponent.fetchdata 上读取未定义的属性(读取'pipe') 我在运行 jasmine 单位测试时,我会在 angular 。现有的现有不喜欢我的…
嘲笑茉莉花中的蜘蛛对象
我的组件订阅了类似服务的可观察到的服务: ngOnInit(): void { this.sub.add( this.notesService.notes$.subscribe(notes => { this.notes = notes.m…
为错误案例写茉莉测试柜,以使其变为绿色
我有一个函数返回最多的参数列表,如果有5个以上的参数,它将引发错误: if (params.length > 5) { throw new Error('Too many arguments'); } 当我们…