package kit
Type Members
-
class
ComRun extends Run
A JSComRun instrumented for testing.
-
class
Run extends AutoCloseable
A JSRun instrumented for testing.
-
final
class
TestKit extends AnyRef
TestKit is a utility class to simplify testing of JSEnvs.
TestKit is a utility class to simplify testing of JSEnvs.
It is mostly used by Scala.js' provided JSEnv test suite but it may be used for additional tests specific to a particular JSEnv.
import scala.concurrent.duration._ val kit = new TestKit(new MyEnv, 1.second) kit.withRun("""console.log("Hello World");""") { _.expectOut("Hello World\n") .closeRun() }
- Note
Methods in TestKit allow to take a string instead of an Input. The string is converted into an input form supported by the JSEnv to execute the code therein.
Example: