File tree Expand file tree Collapse file tree 3 files changed +4
-21
lines changed
bundles/robot_minigame/helpers Expand file tree Collapse file tree 3 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -14,19 +14,8 @@ export function run_tests({
1414} ) : boolean {
1515 // Run each test in order
1616 for ( const test of tests ) {
17- // Store status in a variable
18- let success : boolean ;
19-
20- switch ( test . type ) {
21- case 'area' :
22- success = test . test ( areaLog ) ;
23- break ;
24- default :
25- success = true ;
26- }
27-
28- // If the test fails, return false
29- if ( ! success ) return false ;
17+ // Can replace with a switch statement when more success conditions appear
18+ if ( test . type === 'area' && ! test . test ( areaLog ) ) return false ;
3019 }
3120
3221 // If all tests pass, return true
Original file line number Diff line number Diff line change @@ -123,8 +123,6 @@ const ANIMATION_SPEED : number = 2;
123123 * React Component props for the Tab.
124124 */
125125interface MapProps {
126- children ?: never
127- className ?: never
128126 state : RobotMinigame ,
129127}
130128
Original file line number Diff line number Diff line change @@ -12,8 +12,6 @@ import RobotSimulation from './RobotSimulation';
1212 * React Component props for the Tab.
1313 */
1414interface MainProps {
15- children ?: never
16- className ?: never
1715 context ?: DebuggerContext
1816}
1917
@@ -33,16 +31,14 @@ export default {
3331 * @param {DebuggerContext } context
3432 * @returns {boolean }
3533 */
36- toSpawn ( context : DebuggerContext ) {
37- return context . context ?. moduleContexts ?. robot_minigame . state . isInit ;
38- } ,
34+ toSpawn : ( context : DebuggerContext ) => context . context ?. moduleContexts ?. robot_minigame . state . isInit ,
3935
4036 /**
4137 * This function will be called to render the module tab in the side contents
4238 * on Source Academy frontend.
4339 * @param {DebuggerContext } context
4440 */
45- body : ( context : any ) => < RobotMaze context = { context } /> ,
41+ body : ( context : DebuggerContext ) => < RobotMaze context = { context } /> ,
4642
4743 /**
4844 * The Tab's icon tooltip in the side contents on Source Academy frontend.
You can’t perform that action at this time.
0 commit comments