From 7cafb3319da8265e39ae1331717208816f64667a Mon Sep 17 00:00:00 2001 From: Kristian Nedrevold-Hansen Date: Mon, 16 Dec 2024 23:36:49 +0100 Subject: [PATCH] Makes the jsbridge for 0.6 respect the runMain -> isTest repurposing. --- .../src/main/scala/bloop/scalajs/JsBridge.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bridges/scalajs-0.6/src/main/scala/bloop/scalajs/JsBridge.scala b/bridges/scalajs-0.6/src/main/scala/bloop/scalajs/JsBridge.scala index d6ad8e7cfc..7b5b48922b 100644 --- a/bridges/scalajs-0.6/src/main/scala/bloop/scalajs/JsBridge.scala +++ b/bridges/scalajs-0.6/src/main/scala/bloop/scalajs/JsBridge.scala @@ -61,7 +61,7 @@ object JsBridge { config: JsConfig, project: Project, classpath: Array[Path], - runMain: java.lang.Boolean, + isTest: java.lang.Boolean, mainClass: Option[String], target: Path, logger: BloopLogger, @@ -87,8 +87,11 @@ object JsBridge { val jarFiles = classpath.filter(isJarFile).map(toIrJar) val scalajsIRFiles = jarFiles.flatMap(_.jar.sjsirFiles) val initializers = - if (!runMain) Nil - else mainClass.map(cls => ModuleInitializer.mainMethodWithArgs(cls, "main")).toList + mainClass match { + case Some(value) => ModuleInitializer.mainMethodWithArgs(value, "main") :: Nil + case None => Nil // TODO check for isTest and setup tests + } + val jsConfig = StandardLinker .Config() .withOptimizer(enableOptimizer)