Class

org.scalajs.jsenv.test.kit

TestKit

Related Doc: package kit

Permalink

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
AnyRef, Any
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)

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def start(input: Seq[Input], config: RunConfig): Run

    Permalink

    Starts a Run for testing.

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

    Permalink

    Starts a Run for testing.

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

    Permalink

    Starts a Run for testing.

  18. def start(code: String): Run

    Permalink

    Starts a Run for testing.

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

    Permalink

    Starts a ComRun for testing.

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

    Permalink

    Starts a ComRun for testing.

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

    Permalink

    Starts a ComRun for testing.

  22. def startWithCom(code: String): ComRun

    Permalink

    Starts a ComRun for testing.

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. def withComRun[T](input: Seq[Input], config: RunConfig)(body: (ComRun) ⇒ T): T

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

Inherited from AnyRef

Inherited from Any

Ungrouped