我一直在努力让Cuttzpah 和Jasmine 打得好。这是一个不再积极维护的遗留项目,所以我正在尝试使用我目前拥有的东西。
使用 Chutzpah 运行测试时,我收到各种各样的虚假错误:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
done()
回调。Uncaught TypeError: Cannot read properties of undefined (reading '<object>') thrown
该项目的前端是用 Knockout、Durandel 和 RequireJS 构建的。以下是我的
Chutzpah.json
:
{
"Framework": "jasmine",
"FrameworkVersion": "2",
"TestHarnessReferenceMode": "AMD",
"TestHarnessLocationMode": "SettingsFileAdjacent",
"References": [
{ "Path": "require.js" },
{ "Path": "config.js" }
],
"Tests": [{ "Path": "specs" }],
"CodeCoverageIncludes": ["*\\app\\*"],
"CodeCoverageSuccessPercentage": 84, //currently our lowest completely tested file percentage
"Engine": "Chrome",
"EngineOptions": {
"ChromeBrowserPath": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
},
"TestFileTimeout": 20000
}
我的问题最终是 Chutzpah 无法同时运行多个测试而不超时。将并行度值设置为 1,您的测试应该会停止超时。