diff options
Diffstat (limited to 'scalajslib/jsbridges')
-rw-r--r-- | scalajslib/jsbridges/0.6/src/mill/scalajslib/bridge/ScalaJSBridge.scala | 15 | ||||
-rw-r--r-- | scalajslib/jsbridges/1.0/src/mill/scalajslib/bridge/ScalaJSBridge.scala | 15 |
2 files changed, 18 insertions, 12 deletions
diff --git a/scalajslib/jsbridges/0.6/src/mill/scalajslib/bridge/ScalaJSBridge.scala b/scalajslib/jsbridges/0.6/src/mill/scalajslib/bridge/ScalaJSBridge.scala index 57fbf65a..5f7bd38b 100644 --- a/scalajslib/jsbridges/0.6/src/mill/scalajslib/bridge/ScalaJSBridge.scala +++ b/scalajslib/jsbridges/0.6/src/mill/scalajslib/bridge/ScalaJSBridge.scala @@ -38,7 +38,7 @@ class ScalaJSBridge extends mill.scalajslib.ScalaJSBridge { def getFramework(config: NodeJSConfig, frameworkName: String, - linkedFile: File): sbt.testing.Framework = { + linkedFile: File): (() => Unit, sbt.testing.Framework) = { val env = nodeJSEnv(config).loadLibs( Seq(ResolvedJSDependency.minimal(new FileVirtualJSFile(linkedFile))) ) @@ -47,11 +47,14 @@ class ScalaJSBridge extends mill.scalajslib.ScalaJSBridge { val adapter = new TestAdapter(env, tconfig) - adapter - .loadFrameworks(List(List(frameworkName))) - .flatten - .headOption - .getOrElse(throw new RuntimeException("Failed to get framework")) + ( + () => adapter.close(), + adapter + .loadFrameworks(List(List(frameworkName))) + .flatten + .headOption + .getOrElse(throw new RuntimeException("Failed to get framework")) + ) } def nodeJSEnv(config: NodeJSConfig): NodeJSEnv = { diff --git a/scalajslib/jsbridges/1.0/src/mill/scalajslib/bridge/ScalaJSBridge.scala b/scalajslib/jsbridges/1.0/src/mill/scalajslib/bridge/ScalaJSBridge.scala index d7ed26eb..53986f1b 100644 --- a/scalajslib/jsbridges/1.0/src/mill/scalajslib/bridge/ScalaJSBridge.scala +++ b/scalajslib/jsbridges/1.0/src/mill/scalajslib/bridge/ScalaJSBridge.scala @@ -37,18 +37,21 @@ class ScalaJSBridge extends mill.scalajslib.ScalaJSBridge { def getFramework(config: NodeJSConfig, frameworkName: String, - linkedFile: File): sbt.testing.Framework = { + linkedFile: File): (() => Unit, sbt.testing.Framework) = { val env = nodeJSEnv(config) val tconfig = TestAdapter.Config().withLogger(new ScalaConsoleLogger) val adapter = new TestAdapter(env, Seq(FileVirtualJSFile(linkedFile)), tconfig) - adapter - .loadFrameworks(List(List(frameworkName))) - .flatten - .headOption - .getOrElse(throw new RuntimeException("Failed to get framework")) + ( + () => adapter.close(), + adapter + .loadFrameworks(List(List(frameworkName))) + .flatten + .headOption + .getOrElse(throw new RuntimeException("Failed to get framework")) + ) } def nodeJSEnv(config: NodeJSConfig): NodeJSEnv = { |