generated from robo-technical-group/javascript-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.ts
30 lines (26 loc) · 886 Bytes
/
tests.ts
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
namespace Tests {
export const TESTING_KEY: string = 'CURRENT_TEST'
const TITLE: string = '** TESTING MODE **'
const INSTRUCTIONS: string = 'Stop tests in system menu.'
export function run(): void {
let currTest: number = 0
if (settings.exists(TESTING_KEY)) {
currTest = settings.readNumber(TESTING_KEY)
} else {
settings.writeNumber(TESTING_KEY, currTest)
}
switch (currTest) {
default:
// Restart tests upon reboot
currTest = -1
splash('No tests found. Why not write some!')
break
}
currTest++
settings.writeNumber(TESTING_KEY, currTest)
}
function splash(message: string): void {
game.showLongText(TITLE + '\n' + message + '\n' + INSTRUCTIONS,
DialogLayout.Full)
}
}