File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1458,11 +1458,7 @@ fn start_module_pool(
14581458 workers : Int ,
14591459) -> Nil
14601460
1461- @ target ( erlang )
1461+ @ external ( javascript , "./unitest_ffi.mjs" , "yieldThen" )
14621462fn yield_then ( next : fn ( ) -> Nil ) -> Nil {
14631463 next ( )
14641464}
1465-
1466- @ target ( javascript )
1467- @ external ( javascript , "./unitest_ffi.mjs" , "yieldThen" )
1468- fn yield_then ( next : fn ( ) -> Nil ) -> Nil
Original file line number Diff line number Diff line change @@ -11,11 +11,10 @@ const gleam_extension = ".gleam"
1111
1212const test_directory = "test"
1313
14- @ target ( erlang )
15- const current_target = "erlang"
16-
17- @ target ( javascript )
18- const current_target = "javascript"
14+ @ external ( javascript , "../../unitest_ffi.mjs" , "currentTarget" )
15+ fn current_target ( ) -> String {
16+ "erlang"
17+ }
1918
2019pub type LineSpan {
2120 LineSpan ( start_line : Int , end_line : Int )
@@ -137,7 +136,7 @@ fn tests_from_contents(
137136}
138137
139138pub fn parse_module ( source : String ) -> Result ( List ( ParsedTest ) , glance . Error ) {
140- parse_module_for_target ( source , current_target )
139+ parse_module_for_target ( source , current_target ( ) )
141140}
142141
143142pub fn parse_module_for_target (
Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ export function nowMs() {
101101 return Math . round ( performance . now ( ) ) ;
102102}
103103
104+ export function currentTarget ( ) {
105+ return "javascript" ;
106+ }
107+
104108export function halt ( code ) {
105109 if ( runtime === "node" ) {
106110 process . exitCode = code ;
You can’t perform that action at this time.
0 commit comments