Skip to content

Commit 3e38eb4

Browse files
author
Alexander Vakrilov
authored
Increase timeout for HTTP tests (NativeScript#4775)
1 parent 966a256 commit 3e38eb4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tests/app/TKUnit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ function runAsync(testInfo: TestInfoEntry, recursiveIndex: number, testTimeout?:
118118
testInfo.isPassed = true;
119119
runTests(testsQueue, recursiveIndex + 1);
120120
} else if (error) {
121-
write(`--- ["${testInfo.testName}"] FAILED: ${error.message}, duration: ${duration}`, trace.messageType.error);
121+
write(`--- [${testInfo.testName}] FAILED: ${error.message}, duration: ${duration}`, trace.messageType.error);
122122
testInfo.errorMessage = error.message;
123123
runTests(testsQueue, recursiveIndex + 1);
124124
} else {
125125
const testEndTime = time();
126126
if (testEndTime - testStartTime > timeout) {
127-
write(`--- ["${testInfo.testName}"] TIMEOUT, duration: ${duration}`, trace.messageType.error);
127+
write(`--- [${testInfo.testName}] TIMEOUT, duration: ${duration}`, trace.messageType.error);
128128
testInfo.errorMessage = "Test timeout.";
129129
runTests(testsQueue, recursiveIndex + 1);
130130
} else {

tests/app/testRunner.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ allTests["SEARCH-BAR"] = searchBarTests;
238238
import * as navigationTests from "./navigation/navigation-tests";
239239
allTests["NAVIGATION"] = navigationTests;
240240

241+
const testsSuitesWithLongDelay = {
242+
HTTP: 15 * 1000,
243+
}
244+
241245
const testsWithLongDelay = {
242246
testLocation: 10000,
243247
testLocationOnce: 10000,
@@ -433,7 +437,7 @@ export function runAll(testSelector?: string) {
433437
if (test.setUp) {
434438
testsQueue.push(new TestInfo(test.setUp, test));
435439
}
436-
const testTimeout = testsWithLongDelay[testName];
440+
const testTimeout = testsWithLongDelay[testName] || testsSuitesWithLongDelay[name];
437441
testsQueue.push(new TestInfo(testFunction, test, true, name + "." + testName, false, null, testTimeout));
438442
if (test.tearDown) {
439443
testsQueue.push(new TestInfo(test.tearDown, test));

0 commit comments

Comments
 (0)