org.scalajs.jsenv.test.kit

TestKit

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
Learn more about member selection
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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. def start(input: Input, config: RunConfig): Run

    Starts a Run for testing.

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

    Starts a Run for testing.

  19. def start(input: Input): Run

    Starts a Run for testing.

  20. def start(code: String): Run

    Starts a Run for testing.

  21. def startWithCom(input: Input, config: RunConfig): ComRun

    Starts a ComRun for testing.

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

    Starts a ComRun for testing.

  23. def startWithCom(input: Input): ComRun

    Starts a ComRun for testing.

  24. def startWithCom(code: String): ComRun

    Starts a ComRun for testing.

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

    Definition Classes
    AnyRef
  26. def toString(): String

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  37. 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