I have been struggling to get Chutzpah and Jasmine to play nicely. This is on a legacy project that's no longer actively maintained, so I'm trying to work with what I have at the moment.
When running tests with Chutzpah, I get an assortment of bogus errors:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
done()
callback.Uncaught TypeError: Cannot read properties of undefined (reading '<object>') thrown
The frontend of this project is built with Knockout, Durandel, and RequireJS. Below is my 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
}
My problem ended up being that Chutzpah could not run multiple tests at once without timing out. Set your parallelism value to 1 and your tests should stop timing out.