Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,8 @@ final class TestKit(jsEnv: JSEnv, timeout: FiniteDuration,
}

/** Converts a Path to an Input based on this Kit's defaultInputKind */
def pathToInput(path: Path): Input = {
import TestKit.InputKind._

defaultInputKind match {
case Script => Input.Script(path)
case CommonJSModule => Input.CommonJSModule(path)
case ESModule => Input.ESModule(path)
}
}
def pathToInput(path: Path): Input =
TestKit.pathToInput(path, defaultInputKind)

private def io[T <: JSRun](config: RunConfig)(start: RunConfig => T): (T, IOReader, IOReader) = {
val out = new IOReader
Expand Down Expand Up @@ -174,6 +167,17 @@ object TestKit {
private val completer =
ExecutionContext.fromExecutor(Executors.newSingleThreadExecutor())

/** Converts a Path to an Input based on the inputKind. */
def pathToInput(path: Path, inputKind: InputKind): Input = {
import InputKind._

inputKind match {
case Script => Input.Script(path)
case CommonJSModule => Input.CommonJSModule(path)
case ESModule => Input.ESModule(path)
}
}

sealed trait InputKind

object InputKind {
Expand Down