Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.

Commit 70bee58

Browse files
committed
Use timeout only on mobile.
Otherwise, there is an unnecessary delay when run on desktop.
1 parent f6e24ff commit 70bee58

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/TestServer/UnitTestFramework.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,17 @@ UnitTestFramework.prototype.startTests = function(platform, tests) {
9494
}
9595
});
9696

97-
// The timeout is added as a workaround for an issue
98-
// where the client hasn't necessarily had time
99-
// to add correct listeners on the socket
100-
setTimeout(function() {
101-
// Start setup for this test
97+
if (typeof jxcore !== 'undefined' && jxcore.utils.OSInfo().isMobile) {
98+
// The timeout is added as a workaround for an issue
99+
// where the client hasn't necessarily had time
100+
// to add correct listeners on the socket
101+
setTimeout(function() {
102+
// Start setup for this test
103+
device.socket.emit("setup", test);
104+
}, 1000);
105+
} else {
102106
device.socket.emit("setup", test);
103-
}, 1000);
107+
}
104108
});
105109
}
106110

0 commit comments

Comments
 (0)