【发布时间】:2018-12-04 13:10:50
【问题描述】:
我的 JS 文件:
outer.fucntionMethod = funtion () {
inner.functionMethod = (function (intput) {
var temp = intput.spilt("inner").join("funtionMethod");
return temp;
});
}
我需要编写单元测试这个方法:“inner.functionMethod()”
【问题讨论】:
-
inner是如何定义的?您是否可以在测试中同时访问inner和outer?如果你这样做了,那么你只需执行outer.functionMethod(),然后inner.functionMethod就会被定义,你可以像任何其他函数一样测试它。
标签: javascript jasmine chutzpah