MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / checkFinished

Function checkFinished

apps/automated/src/tk-unit.ts:103–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101
102 let duration;
103 const checkFinished = () => {
104 duration = time() - testStartTime;
105 testInfo.duration = duration;
106 if (isDone) {
107 write(`--- [${testInfo.testName}] OK, duration: ${duration.toFixed(2)}`, Trace.messageType.info);
108 testInfo.isPassed = true;
109 runTests(testsQueue, recursiveIndex + 1);
110 } else if (error) {
111 write(`--- [${testInfo.testName}] FAILED: ${error.message}, duration: ${duration.toFixed(2)}`, Trace.messageType.error);
112 testInfo.errorMessage = error.message;
113 runTests(testsQueue, recursiveIndex + 1);
114 } else {
115 const testEndTime = time();
116 if (testEndTime - testStartTime > timeout) {
117 write(`--- [${testInfo.testName}] TIMEOUT, duration: ${duration.toFixed(2)}`, Trace.messageType.error);
118 testInfo.errorMessage = 'Test timeout.';
119 runTests(testsQueue, recursiveIndex + 1);
120 } else {
121 setTimeout(checkFinished, 20);
122 }
123 }
124 };
125
126 try {
127 if (testInfo.instance) {

Callers

nothing calls this directly

Calls 4

timeFunction · 0.70
writeFunction · 0.70
runTestsFunction · 0.70
setTimeoutFunction · 0.50

Tested by

no test coverage detected