在打字稿中使用jest的测试方法

时间:2018-04-12 10:57:31

标签: typescript jest

我需要一些帮助,而且我对Jest很新。这是片段,我传递Json作为输入,你能帮忙写一下Jest测试用例来测试Call ID / SectionId是一个数字,SectionName是一个字符串,输入也是一个Json。

class sections {
    constructor() {   
    }
    public getSections(section): void {
        for (let k = 0; k<section.length; k++){
        console.log('CallId: '+section[k].CallId+', SectionId: 
        '+section[k].SectionId+', SectionName:  '+section[k].SectionName);
            }                   
    }
}    
export default new sections();

0 个答案:

没有答案