【发布时间】:2010-12-19 17:10:54
【问题描述】:
我正在使用 JsTestDriver 和一点 Jack(仅在需要时)。有谁知道如何验证单元测试期间是否调用了 javascript 函数?
例如
function MainFunction()
{
var someElement = ''; // or = some other type
anotherFunction(someElement);
}
并在测试代码中:
Test.prototype.test_mainFunction()
{
MainFunction();
// TODO how to verify anotherFunction(someElement) (and its logic) has been called?
}
谢谢。
【问题讨论】:
标签: javascript unit-testing mocking