Packages

object TestAspect extends TimeoutVariants

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestAspect
  2. TimeoutVariants
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type CheckAspect = ZIOAspect[Nothing, Any, Nothing, Any, TestResult, TestResult]
  2. abstract class PerTest[+LowerR, -UpperR, +LowerE, -UpperE] extends TestAspect[LowerR, UpperR, LowerE, UpperE]

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. def after[R0, E0](effect: ZIO[R0, E0, Any]): TestAspect[Nothing, R0, E0, Any]

    Constructs an aspect that runs the specified effect after every test.

  5. def afterAll[R0](effect: ZIO[R0, Nothing, Any]): TestAspect[Nothing, R0, Nothing, Any]

    Constructs an aspect that runs the specified effect after all tests.

  6. def afterAllFailure[R0](f: ZIO[R0, Nothing, Any]): TestAspect[Nothing, R0, Nothing, Any]

    Constructs an aspect that runs the specified effect after all tests if there is at least one failure.

  7. def afterAllSuccess[R0](f: ZIO[R0, Nothing, Any]): TestAspect[Nothing, R0, Nothing, Any]

    Constructs an aspect that runs the specified effect after all tests if there are no failures.

  8. def afterFailure[R0, E0](effect: ZIO[R0, E0, Any]): TestAspect[Nothing, R0, E0, Any]

    Constructs an aspect that runs the specified effect after every failed test.

  9. def afterSuccess[R0, E0](effect: ZIO[R0, E0, Any]): TestAspect[Nothing, R0, E0, Any]

    Constructs an aspect that runs the specified effect after every successful test.

  10. def annotate[V](key: TestAnnotation[V], value: V): TestAspectPoly

    Annotates tests with the specified test annotation.

  11. def around[R0, E0](before: ZIO[R0, E0, Any], after: ZIO[R0, Nothing, Any]): TestAspect[Nothing, R0, E0, Any]

    A less powerful variant of around where the result of before is not required by after.

  12. def aroundAll[R0, E0](before: ZIO[R0, E0, Any], after: ZIO[R0, Nothing, Any]): TestAspect[Nothing, R0, E0, Any]

    A less powerful variant of aroundAll where the result of before is not required by after.

  13. def aroundAllWith[R0, E0, A0](before: ZIO[R0, E0, A0])(after: (A0) => ZIO[R0, Nothing, Any]): TestAspect[Nothing, R0, E0, Any]

    Constructs an aspect that evaluates all tests between two effects, before and after, where the result of before can be used in after.

  14. def aroundTest[R0, E0](scoped: ZIO[Scope with R0, TestFailure[E0], (TestSuccess) => ZIO[R0, TestFailure[E0], TestSuccess]]): TestAspect[Nothing, R0, E0, Any]

    Constructs an aspect that evaluates every test inside the context of the scoped function.

  15. def aroundWith[R0, E0, A0](before: ZIO[R0, E0, A0])(after: (A0) => ZIO[R0, Nothing, Any]): TestAspect[Nothing, R0, E0, Any]

    Constructs an aspect that evaluates every test between two effects, before and after, where the result of before can be used in after.

  16. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  17. def aspect[R0, E0](f: (ZIO[R0, TestFailure[E0], TestSuccess]) => ZIO[R0, TestFailure[E0], TestSuccess]): TestAspect[R0, R0, E0, E0]

    Constructs a simple monomorphic aspect that only works with the specified environment and error type.

  18. def before[R0, E0](effect: ZIO[R0, E0, Any]): TestAspect[Nothing, R0, E0, Any]

    Constructs an aspect that runs the specified effect before every test.

  19. def beforeAll[R0, E0](effect: ZIO[R0, E0, Any]): TestAspect[Nothing, R0, E0, Any]

    Constructs an aspect that runs the specified effect a single time before all tests.

  20. val blocking: TestAspectPoly

    An aspect that runs each test on the blocking threadpool.

    An aspect that runs each test on the blocking threadpool. Useful for tests that contain blocking code

  21. def checks(aspect: CheckAspect): TestAspectPoly

    An aspect that applies the provided zio aspect to each sample of all checks in the test.

    An aspect that applies the provided zio aspect to each sample of all checks in the test.

    i.e.

    test("example") {
      check(Gen.int) { i =>
        ZIO.succeed(assert(i, Assertion.equalTo(1)))
      }
    } @@ checks(ZIOAspect.debug)

    is equivalent to

    test("example") {
      check(Gen.int) { i =>
        ZIO.succeed(assert(i, Assertion.equalTo(1))) @@ ZIOAspect.debug
      }
    }
  22. def checksZIO[R, E](makeAspect: ZIO[R, E, CheckAspect]): TestAspect[Nothing, R, E, Any]

    An aspect that applies the provided zio aspect to each sample of all checks in the test.

    An aspect that applies the provided zio aspect to each sample of all checks in the test. The aspect will be constructed from the provided effect before each test is run.

  23. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  24. val debug: TestAspectPoly

    An aspect that runs each test with the TestConsole instance in the environment set to debug mode so that console output is rendered to standard output in addition to being written to the output buffer.

  25. def diagnose(duration: zio.Duration): TestAspectPoly

    An aspect that runs each test on a separate fiber and prints a fiber dump if the test fails or has not terminated within the specified duration.

  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  28. val eventually: TestAspectPoly

    An aspect that retries a test until success, without limit.

  29. def exceptJS[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that that applies an aspect on all platforms except ScalaJS.

  30. val exceptJS: TestAspectPoly

    An aspect that runs tests on all platforms except ScalaJS.

  31. def exceptJVM[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that that applies an aspect on all platforms except the JVM.

  32. val exceptJVM: TestAspectPoly

    An aspect that runs tests on all platforms except the JVM.

  33. def exceptNative[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that that applies an aspect on all platforms except ScalaNative.

  34. val exceptNative: TestAspectPoly

    An aspect that runs tests on all platforms except ScalaNative.

  35. val exceptScala2: TestAspectPoly

    An aspect that runs tests on all versions except Scala 2.

  36. val exceptScala212: TestAspectPoly

    An aspect that runs tests on all versions except Scala 2.12.

  37. val exceptScala213: TestAspectPoly

    An aspect that runs tests on all versions except Scala 2.13.

  38. val exceptScala3: TestAspectPoly

    An aspect that runs tests on all versions except Scala 3.

  39. def executionStrategy(exec: ExecutionStrategy): TestAspectPoly

    An aspect that sets suites to the specified execution strategy, but only if their current strategy is inherited (undefined).

  40. def failing[E0](assertion: (TestFailure[E0]) => Boolean): TestAspect[Nothing, Any, Nothing, E0]

    An aspect that makes a test that failed for the specified failure pass.

    An aspect that makes a test that failed for the specified failure pass. Note that the test will fail for other failures and also if it passes correctly.

  41. val failing: TestAspectPoly

    An aspect that makes a test that failed for any reason pass.

    An aspect that makes a test that failed for any reason pass. Note that if the test passes this aspect will make it fail.

  42. lazy val fibers: TestAspectPoly

    An aspect that records the state of fibers spawned by the current test in TestAnnotation.fibers.

    An aspect that records the state of fibers spawned by the current test in TestAnnotation.fibers. Applied by default in ZIOSpecAbstract. This aspect is required for the proper functioning of TestClock.adjust.

  43. def flaky(n: Int): TestAspectPoly

    An aspect that retries a test until success, with the specified limit, for use with flaky tests.

  44. val flaky: TestAspectPoly

    An aspect that retries a test until success, with a default limit, for use with flaky tests.

  45. val forked: TestAspectPoly

    An aspect that runs each test on its own separate fiber.

  46. def fromLayer[R0, E0](layer: ZLayer[R0, E0, Any]): TestAspect[Nothing, R0, E0, Any]

    An aspect that provides each test with the specified layer that does not produce any services.

  47. def fromLayerShared[R0, E0](layer: ZLayer[R0, E0, Any]): TestAspect[Nothing, R0, E0, Any]

    An aspect that provides all tests with a shared version of the specified layer that does not produce any services.

  48. def fromZIOAspect[LowerR, UpperR, LowerE, UpperE](zioAspect: ZIOAspect[LowerR, UpperR, TestFailure[LowerE], TestFailure[UpperE], TestSuccess, TestSuccess]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    As aspect that runs each test with the specified ZIOAspect.

  49. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  50. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  51. val identity: TestAspectPoly

    An aspect that returns the tests unchanged

  52. def ifEnv(env: String)(assertion: (String) => Boolean): TestAspectPoly

    An aspect that only runs a test if the specified environment variable satisfies the specified assertion.

  53. def ifEnvNotSet(env: String): TestAspectPoly

    An aspect that only runs a test if the specified environment variable is not set.

  54. def ifEnvOption(env: String)(assertion: (Option[String]) => Boolean): TestAspectPoly

    An aspect that only runs a test if the specified optional environment variable satisfies the specified assertion.

  55. def ifEnvSet(env: String): TestAspectPoly

    An aspect that only runs a test if the specified environment variable is set.

  56. def ifProp(prop: String)(assertion: (String) => Boolean): TestAspectPoly

    An aspect that only runs a test if the specified Java property satisfies the specified assertion.

  57. def ifPropNotSet(env: String): TestAspectPoly

    An aspect that only runs a test if the specified Java property is not set.

  58. def ifPropOption(prop: String)(assertion: (Option[String]) => Boolean): TestAspectPoly

    An aspect that only runs a test if the specified optional Java property satisfies the specified assertion.

  59. def ifPropSet(prop: String): TestAspectPoly

    An aspect that only runs a test if the specified Java property is set.

  60. val ignore: TestAspectPoly

    An aspect that marks tests as ignored.

  61. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  62. def js[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that applies the specified aspect on ScalaJS.

  63. val jsOnly: TestAspectPoly

    An aspect that only runs tests on ScalaJS.

  64. def jvm[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that applies the specified aspect on the JVM.

  65. val jvmOnly: TestAspectPoly

    An aspect that only runs tests on the JVM.

  66. val mac: TestAspectPoly

    Runs only on Mac operating systems.

  67. def native[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that applies the specified aspect on ScalaNative.

  68. val nativeOnly: TestAspectPoly

    An aspect that only runs tests on ScalaNative.

  69. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  70. def nonFlaky(n: Int): TestAspectPoly

    An aspect that repeats the test a specified number of times, ensuring it is stable ("non-flaky").

    An aspect that repeats the test a specified number of times, ensuring it is stable ("non-flaky"). Stops at the first failure.

  71. val nonFlaky: TestAspectPoly

    An aspect that repeats the test a default number of times, ensuring it is stable ("non-flaky").

    An aspect that repeats the test a default number of times, ensuring it is stable ("non-flaky"). Stops at the first failure.

  72. def nonTermination(duration: zio.Duration): TestAspectPoly

    Constructs an aspect that requires a test to not terminate within the specified time.

  73. val nondeterministic: TestAspectPoly

    Sets the seed of the TestRandom instance in the environment to a random value before each test.

  74. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  75. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  76. def os(f: (OS) => Boolean): TestAspectPoly

    An aspect that runs only on operating systems accepted by the specified predicate.

  77. val parallel: TestAspectPoly

    An aspect that executes the members of a suite in parallel.

  78. def parallelN(n: Int): TestAspectPoly

    An aspect that executes the members of a suite in parallel, up to the specified number of concurrent fibers.

  79. def repeat[R0](schedule: Schedule[R0, TestSuccess, Any]): TestAspectAtLeastR[R0]

    An aspect that repeats successful tests according to a schedule.

  80. def repeats(n: Int): TestAspectPoly

    An aspect that runs each test with the number of times to repeat tests to ensure they are stable set to the specified value.

  81. def restore(restorable: UIO[Restorable]): TestAspectPoly

    An aspect that restores a given Restorable's state to its starting state after the test is run.

    An aspect that restores a given Restorable's state to its starting state after the test is run. Note that this is only useful when repeating tests.

  82. def restoreTestClock: TestAspectPoly

    An aspect that restores the TestClock's state to its starting state after the test is run.

    An aspect that restores the TestClock's state to its starting state after the test is run. Note that this is only useful when repeating tests.

  83. def restoreTestConsole: TestAspectPoly

    An aspect that restores the TestConsole's state to its starting state after the test is run.

    An aspect that restores the TestConsole's state to its starting state after the test is run. Note that this is only useful when repeating tests.

  84. def restoreTestEnvironment: TestAspectPoly

    An aspect that restores all state in the standard provided test environments (TestClock, TestConsole, TestRandom, and TestSystem) to their starting state after the test is run.

    An aspect that restores all state in the standard provided test environments (TestClock, TestConsole, TestRandom, and TestSystem) to their starting state after the test is run. Note that this is only useful when repeating tests.

  85. def restoreTestRandom: TestAspectPoly

    An aspect that restores the TestRandom's state to its starting state after the test is run.

    An aspect that restores the TestRandom's state to its starting state after the test is run. Note that this is only useful when repeating tests.

  86. def restoreTestSystem: TestAspectPoly

    An aspect that restores the TestSystem's state to its starting state after the test is run.

    An aspect that restores the TestSystem's state to its starting state after the test is run. Note that this is only useful when repeating tests.

  87. def retries(n: Int): TestAspectPoly

    An aspect that runs each test with the number of times to retry flaky tests set to the specified value.

  88. def retry[R0, E0](schedule: Schedule[R0, TestFailure[E0], Any]): TestAspect[Nothing, R0, Nothing, E0]

    An aspect that retries failed tests according to a schedule.

  89. def samples(n: Int): TestAspectPoly

    An aspect that runs each test with the number of sufficient samples to check for a random variable set to the specified value.

  90. def scala2[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that applies the specified aspect on Scala 2.

  91. def scala212[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that applies the specified aspect on Scala 2.12.

  92. val scala212Only: TestAspectPoly

    An aspect that only runs tests on Scala 2.12.

  93. def scala213[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that applies the specified aspect on Scala 2.13.

  94. val scala213Only: TestAspectPoly

    An aspect that only runs tests on Scala 2.13.

  95. val scala2Only: TestAspectPoly

    An aspect that only runs tests on Scala 2.

  96. def scala3[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

    An aspect that applies the specified aspect on Scala 3.

  97. val scala3Only: TestAspectPoly

    An aspect that only runs tests on Scala 3.

  98. val sequential: TestAspectPoly

    An aspect that executes the members of a suite sequentially.

  99. def setSeed(seed: => Long): TestAspectPoly

    Sets the seed of the TestRandom instance in the environment to the specified value before each test.

  100. def shrinks(n: Int): TestAspectPoly

    An aspect that runs each test with the maximum number of shrinkings to minimize large failures set to the specified value.

  101. val silent: TestAspectPoly

    An aspect that runs each test with the TestConsole instance in the environment set to silent mode so that console output is only written to the output buffer and not rendered to standard output.

  102. val silentLogging: TestAspectPoly

    As aspect that runs each test with the default console logger removed so that logs are only written to the output buffer and not rendered to standard output.

  103. def size(n: Int): TestAspectPoly

    An aspect that runs each test with the size set to the specified value.

  104. val success: TestAspectPoly

    An aspect that converts ignored tests into test failures.

  105. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  106. def tag(tag: String, tags: String*): TestAspectPoly

    Annotates tests with string tags.

  107. val timed: TestAspectPoly

    Annotates tests with their execution times.

  108. def timeout(duration: zio.Duration): TestAspectPoly

    An aspect that times out tests using the specified duration.

    An aspect that times out tests using the specified duration.

    duration

    maximum test duration

  109. def timeoutWarning(duration: zio.Duration): TestAspectPoly

    A test aspect that prints a warning to the console when a test takes longer than the specified duration.

    A test aspect that prints a warning to the console when a test takes longer than the specified duration.

    Definition Classes
    TimeoutVariants
  110. def toString(): String
    Definition Classes
    AnyRef → Any
  111. val unix: TestAspectPoly

    Runs only on Unix / Linux operating systems.

  112. def verify[R0, E0](condition: => ZIO[R0, E0, TestResult]): TestAspect[Nothing, R0, E0, Any]

    Verifies the specified post-condition after each test is run.

  113. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  114. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  115. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  116. val windows: TestAspectPoly

    Runs only on Windows operating systems.

  117. def withConfigProvider(configProvider: ConfigProvider): TestAspectPoly

    An aspect that runs tests with the specified config provider.

  118. lazy val withLiveClock: TestAspectPoly

    An aspect that runs tests with the live clock service.

  119. lazy val withLiveConsole: TestAspectPoly

    An aspect that runs tests with the live console service.

  120. lazy val withLiveEnvironment: TestAspectPoly

    An aspect that runs tests with the live default ZIO services.

  121. lazy val withLiveRandom: TestAspectPoly

    An aspect that runs tests with the live random service.

  122. lazy val withLiveSystem: TestAspectPoly

    An aspect that runs tests with the live system service.

  123. object PerTest

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def sized(n: Int): TestAspectPoly

    An aspect that runs each test with the size set to the specified value.

    An aspect that runs each test with the size set to the specified value.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.2) use size

Inherited from TimeoutVariants

Inherited from AnyRef

Inherited from Any

Ungrouped