TKUnit: add exception guard and fail the test instead of crashing the app.

This commit is contained in:
Hristo Deshev
2015-06-12 18:58:12 +03:00
parent e2a0c7d587
commit acfb51bba2

View File

@ -120,13 +120,16 @@ function runAsync(testInfo: TestInfoEntry, recursiveIndex: number, testTimeout?:
} }
} }
try {
if (testInfo.instance) { if (testInfo.instance) {
testInfo.testFunc.apply(testInfo.instance, [doneCallback]); testInfo.testFunc.apply(testInfo.instance, [doneCallback]);
} } else {
else {
var func: any = testInfo.testFunc; var func: any = testInfo.testFunc;
func(doneCallback); func(doneCallback);
} }
} catch (e) {
doneCallback(e);
}
setTimeout(checkFinished, 0); setTimeout(checkFinished, 0);
} }