@@ -60,7 +60,10 @@ export function defineTests(
6060 python : [ `${ varName } = ${ value } ` , `print(${ varName } )` ] ,
6161 ruby : [ `${ varName } = ${ value } ` , `puts ${ varName } ` ] ,
6262 cpp : [ null , null ] ,
63- javascript : [ `var ${ varName } = ${ value } ` , `console.log(${ varName } )` ] ,
63+ javascript : [
64+ `var ${ varName } = ${ value } ` ,
65+ `console.log(${ varName } )` ,
66+ ] ,
6467 } satisfies Record < RuntimeLang , string [ ] | null [ ] >
6568 ) [ lang ] ;
6669 if ( ! setIntVarCode || ! printIntVarCode ) {
@@ -109,7 +112,11 @@ export function defineTests(
109112 python : [ `testVar = 42` , `while True:\n pass` , `print(testVar)` ] ,
110113 ruby : [ `testVar = 42` , `loop do\nend` , `puts testVar` ] ,
111114 cpp : [ null , null , null ] ,
112- javascript : [ `var testVar = 42` , `while(true) {}` , `console.log(testVar)` ] ,
115+ javascript : [
116+ `var testVar = 42` ,
117+ `while(true) {}` ,
118+ `console.log(testVar)` ,
119+ ] ,
113120 } satisfies Record < RuntimeLang , ( string | null ) [ ] >
114121 ) [ lang ] ;
115122 if ( ! setIntVarCode || ! infLoopCode || ! printIntVarCode ) {
@@ -156,7 +163,7 @@ export function defineTests(
156163 "test.cpp" ,
157164 `#include <iostream>\nint main() {\n std::cout << "${ msg } " << std::endl;\n return 0;\n}\n` ,
158165 ] ,
159- javascript : [ null , null ] ,
166+ javascript : [ "test.js" , `console.log(" ${ msg } ")` ] ,
160167 } satisfies Record < RuntimeLang , [ string , string ] | [ null , null ] >
161168 ) [ lang ] ;
162169 if ( ! filename || ! code ) {
@@ -185,7 +192,7 @@ export function defineTests(
185192 "test_error.cpp" ,
186193 `#include <stdexcept>\nint main() {\n throw std::runtime_error("${ errorMsg } ");\n return 0;\n}\n` ,
187194 ] ,
188- javascript : [ null , null ] ,
195+ javascript : [ "test_error.js" , `throw new Error(" ${ errorMsg } ");\n` ] ,
189196 } satisfies Record < RuntimeLang , [ string , string ] | [ null , null ] >
190197 ) [ lang ] ;
191198 if ( ! filename || ! code ) {
@@ -230,7 +237,10 @@ export function defineTests(
230237 [ "test_multi_main.cpp" , "test_multi_sub.cpp" ] ,
231238 ] ,
232239 javascript : [ null , null ] ,
233- } satisfies Record < RuntimeLang , [ Record < string , string > , string [ ] ] | [ null , null ] >
240+ } satisfies Record <
241+ RuntimeLang ,
242+ [ Record < string , string > , string [ ] ] | [ null , null ]
243+ >
234244 ) [ lang ] ;
235245 if ( ! codes || ! execFiles ) {
236246 this . skip ( ) ;
0 commit comments