-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnitTests.gs
39 lines (32 loc) · 1.18 KB
/
UnitTests.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const myFunction = (function() {
let count = 0;
return function() {
count = count + 1;
console.log("Execution: "+count);
};
})();
function testRepeat() {
console.log("Starting Test..." + new Date() );
repeat(3, myFunction);
console.log("Ending Test..." + new Date());
}
function testExecuteThenDelay() {
let runThis = function() { return executeThenDelay( 2000, myFunction) };
console.log("Starting Test..." + new Date() );
runThis();
console.log("Ending Test..." + new Date());
}
function testRepeatWithDelay() {
let execWithDelay = function() { executeThenDelay( 2000, myFunction) };
let repeatWithDelay = function() { return repeat( 3, execWithDelay); };
console.log("Starting Test..." + new Date() );
repeatWithDelay();
console.log("Ending Test..." + new Date());
}
function testUserStats() {
let limits = PLAYER.rateLimits();
console.log("code=" + limits.code + ", limit=" + limits.limit + ", remain=" + limits.remain + ", resetTime=" + limits.wakeup);
let response = PLAYER.stats();
limits = PLAYER.rateLimits();
console.log("code=" + limits.code + ", limit=" + limits.limit + ", remain=" + limits.remain + ", resetTime=" + limits.wakeup);
}