final class TestKit extends AnyRef
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.
- Alphabetic
- By Inheritance
- TestKit
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new TestKit(jsEnv: JSEnv, timeout: FiniteDuration)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
start(input: Input, config: RunConfig): Run
Starts a Run for testing.
-
def
start(code: String, config: RunConfig): Run
Starts a Run for testing.
-
def
start(input: Input): Run
Starts a Run for testing.
-
def
start(code: String): Run
Starts a Run for testing.
-
def
startWithCom(input: Input, config: RunConfig): ComRun
Starts a ComRun for testing.
-
def
startWithCom(code: String, config: RunConfig): ComRun
Starts a ComRun for testing.
-
def
startWithCom(input: Input): ComRun
Starts a ComRun for testing.
-
def
startWithCom(code: String): ComRun
Starts a ComRun for testing.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withComRun[T](input: Input, config: RunConfig)(body: (ComRun) ⇒ T): T
Convenience method to start a ComRun and close it after usage.
-
def
withComRun[T](code: String, config: RunConfig)(body: (ComRun) ⇒ T): T
Convenience method to start a ComRun and close it after usage.
-
def
withComRun[T](input: Input)(body: (ComRun) ⇒ T): T
Convenience method to start a ComRun and close it after usage.
-
def
withComRun[T](code: String)(body: (ComRun) ⇒ T): T
Convenience method to start a ComRun and close it after usage.
-
def
withRun[T](input: Input, config: RunConfig)(body: (Run) ⇒ T): T
Convenience method to start a Run and close it after usage.
-
def
withRun[T](code: String, config: RunConfig)(body: (Run) ⇒ T): T
Convenience method to start a Run and close it after usage.
-
def
withRun[T](input: Input)(body: (Run) ⇒ T): T
Convenience method to start a Run and close it after usage.
-
def
withRun[T](code: String)(body: (Run) ⇒ T): T
Convenience method to start a Run and close it after usage.