Packages

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.

Example:
  1. 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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestKit
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TestKit(jsEnv: JSEnv, timeout: FiniteDuration)

    Create a new TestKit for the given JSEnv and timeout.

    Create a new TestKit for the given JSEnv and timeout.

    jsEnv

    The JSEnv to be tested.

    timeout

    Timeout for all expect* methods on Run / ComRun.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. def start(input: Seq[Input], config: RunConfig): Run

    Starts a Run for testing.

  16. def start(code: String, config: RunConfig): Run

    Starts a Run for testing.

  17. def start(input: Seq[Input]): Run

    Starts a Run for testing.

  18. def start(code: String): Run

    Starts a Run for testing.

  19. def startWithCom(input: Seq[Input], config: RunConfig): ComRun

    Starts a ComRun for testing.

  20. def startWithCom(code: String, config: RunConfig): ComRun

    Starts a ComRun for testing.

  21. def startWithCom(input: Seq[Input]): ComRun

    Starts a ComRun for testing.

  22. def startWithCom(code: String): ComRun

    Starts a ComRun for testing.

  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  28. def withComRun[T](input: Seq[Input], config: RunConfig)(body: (ComRun) ⇒ T): T

    Convenience method to start a ComRun and close it after usage.

  29. def withComRun[T](code: String, config: RunConfig)(body: (ComRun) ⇒ T): T

    Convenience method to start a ComRun and close it after usage.

  30. def withComRun[T](input: Seq[Input])(body: (ComRun) ⇒ T): T

    Convenience method to start a ComRun and close it after usage.

  31. def withComRun[T](code: String)(body: (ComRun) ⇒ T): T

    Convenience method to start a ComRun and close it after usage.

  32. def withRun[T](input: Seq[Input], config: RunConfig)(body: (Run) ⇒ T): T

    Convenience method to start a Run and close it after usage.

  33. def withRun[T](code: String, config: RunConfig)(body: (Run) ⇒ T): T

    Convenience method to start a Run and close it after usage.

  34. def withRun[T](input: Seq[Input])(body: (Run) ⇒ T): T

    Convenience method to start a Run and close it after usage.

  35. def withRun[T](code: String)(body: (Run) ⇒ T): T

    Convenience method to start a Run and close it after usage.

Inherited from AnyRef

Inherited from Any

Ungrouped