角度2单元测试案例 [英] angular 2 unit test case

查看:82
本文介绍了角度2单元测试案例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我吗?关于以下.ts代码的单元测试用例


nodeJobExpand(event){

        if(event.node){

            this.jobService.getJobsbyGroup(event.node.data).subscribe((jobInfo:IJob [])=> {

         event.node.children = this.getChildJobTreeNode(jobInfo);

      });

        }¥b $ b    }




解决方案

Hi unit test case,


欢迎来到MSDN论坛。


根据你的描述,你想要单元测试AngularJS代码,对吗?


根据我的研究,你可以使用
Karma
Jasmine
测试AngularJS应用程序的工具,更多信息,请参阅以下文档:


https://docs.angularjs.org / guide / unit-testing#additional-tools-for-testing-angularjs-applications



注意:此响应包含对第三方万维网站点的引用。微软提供此信息是为了方便您。


Microsoft不控制这些网站,也没有测试在这些网站上找到的任何软件或信息;


因此,Microsoft无法对在那里找到的任何软件或信息的质量,安全性或适用性做出任何陈述。


使用互联网上的任何软件都存在固有的危险,微软提醒您在从互联网上检索任何软件之前确保完全理解风险


问候,


Judyzh


Can anyone help me  regarding unit test case for the below .ts code

nodeJobExpand(event) {
        if (event.node) {
            this.jobService.getJobsbyGroup(event.node.data).subscribe((jobInfo: IJob[]) => {
                event.node.children = this.getChildJobTreeNode(jobInfo);
            });
        }
    }

解决方案

Hi unit test case,

Welcome to the MSDN forum.

According to your description, you want to unit test AngularJS code, right?

Based on my research, you could use Karma or Jasmine tools to test AngularJS applications, more information, please see following document:

https://docs.angularjs.org/guide/unit-testing#additional-tools-for-testing-angularjs-applications

Note: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you.

Microsoft does not control these sites and has not tested any software or information found on these sites;

Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

Regards,

Judyzh


这篇关于角度2单元测试案例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆