object TestAspect extends TimeoutVariants
- Alphabetic
- By Inheritance
- TestAspect
- TimeoutVariants
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type CheckAspect = ZIOAspect[Nothing, Any, Nothing, Any, TestResult, TestResult]
- abstract class PerTest[+LowerR, -UpperR, +LowerE, -UpperE] extends TestAspect[LowerR, UpperR, LowerE, UpperE]
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
- 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.
- def afterAll[R0](effect: ZIO[R0, Nothing, Any]): TestAspect[Nothing, R0, Nothing, Any]
Constructs an aspect that runs the specified effect after all tests.
- 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.
- 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.
- 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.
- 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.
- def annotate[V](key: TestAnnotation[V], value: V): TestAspectPoly
Annotates tests with the specified test annotation.
- 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 ofbefore
is not required by after. - 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 ofbefore
is not required byafter
. - 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
andafter
, where the result ofbefore
can be used inafter
. - 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.
- 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
andafter
, where the result ofbefore
can be used inafter
. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- 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.
- 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.
- 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.
- 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
- 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 } }
- 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.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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. - 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.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- val eventually: TestAspectPoly
An aspect that retries a test until success, without limit.
- 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.
- val exceptJS: TestAspectPoly
An aspect that runs tests on all platforms except ScalaJS.
- 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.
- val exceptJVM: TestAspectPoly
An aspect that runs tests on all platforms except the JVM.
- 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.
- val exceptNative: TestAspectPoly
An aspect that runs tests on all platforms except ScalaNative.
- val exceptScala2: TestAspectPoly
An aspect that runs tests on all versions except Scala 2.
- val exceptScala212: TestAspectPoly
An aspect that runs tests on all versions except Scala 2.12.
- val exceptScala213: TestAspectPoly
An aspect that runs tests on all versions except Scala 2.13.
- val exceptScala3: TestAspectPoly
An aspect that runs tests on all versions except Scala 3.
- def executionStrategy(exec: ExecutionStrategy): TestAspectPoly
An aspect that sets suites to the specified execution strategy, but only if their current strategy is inherited (undefined).
- 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.
- 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.
- 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
. - def flaky(n: Int): TestAspectPoly
An aspect that retries a test until success, with the specified limit, for use with flaky tests.
- val flaky: TestAspectPoly
An aspect that retries a test until success, with a default limit, for use with flaky tests.
- val forked: TestAspectPoly
An aspect that runs each test on its own separate fiber.
- 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.
- 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.
- 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
. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val identity: TestAspectPoly
An aspect that returns the tests unchanged
- def ifEnv(env: String)(assertion: (String) => Boolean): TestAspectPoly
An aspect that only runs a test if the specified environment variable satisfies the specified assertion.
- def ifEnvNotSet(env: String): TestAspectPoly
An aspect that only runs a test if the specified environment variable is not set.
- 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.
- def ifEnvSet(env: String): TestAspectPoly
An aspect that only runs a test if the specified environment variable is set.
- def ifProp(prop: String)(assertion: (String) => Boolean): TestAspectPoly
An aspect that only runs a test if the specified Java property satisfies the specified assertion.
- def ifPropNotSet(env: String): TestAspectPoly
An aspect that only runs a test if the specified Java property is not set.
- 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.
- def ifPropSet(prop: String): TestAspectPoly
An aspect that only runs a test if the specified Java property is set.
- val ignore: TestAspectPoly
An aspect that marks tests as ignored.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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.
- val jsOnly: TestAspectPoly
An aspect that only runs tests on ScalaJS.
- 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.
- val jvmOnly: TestAspectPoly
An aspect that only runs tests on the JVM.
- val mac: TestAspectPoly
Runs only on Mac operating systems.
- 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.
- val nativeOnly: TestAspectPoly
An aspect that only runs tests on ScalaNative.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- 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.
- 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.
- def nonTermination(duration: zio.Duration): TestAspectPoly
Constructs an aspect that requires a test to not terminate within the specified time.
- val nondeterministic: TestAspectPoly
Sets the seed of the
TestRandom
instance in the environment to a random value before each test. - final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def os(f: (OS) => Boolean): TestAspectPoly
An aspect that runs only on operating systems accepted by the specified predicate.
- val parallel: TestAspectPoly
An aspect that executes the members of a suite in parallel.
- def parallelN(n: Int): TestAspectPoly
An aspect that executes the members of a suite in parallel, up to the specified number of concurrent fibers.
- def repeat[R0](schedule: Schedule[R0, TestSuccess, Any]): TestAspectAtLeastR[R0]
An aspect that repeats successful tests according to a schedule.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- val scala212Only: TestAspectPoly
An aspect that only runs tests on Scala 2.12.
- 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.
- val scala213Only: TestAspectPoly
An aspect that only runs tests on Scala 2.13.
- val scala2Only: TestAspectPoly
An aspect that only runs tests on Scala 2.
- 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.
- val scala3Only: TestAspectPoly
An aspect that only runs tests on Scala 3.
- val sequential: TestAspectPoly
An aspect that executes the members of a suite sequentially.
- def setSeed(seed: => Long): TestAspectPoly
Sets the seed of the
TestRandom
instance in the environment to the specified value before each test. - 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.
- 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.
- 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.
- def size(n: Int): TestAspectPoly
An aspect that runs each test with the size set to the specified value.
- val success: TestAspectPoly
An aspect that converts ignored tests into test failures.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tag(tag: String, tags: String*): TestAspectPoly
Annotates tests with string tags.
- val timed: TestAspectPoly
Annotates tests with their execution times.
- 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
- 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
- def toString(): String
- Definition Classes
- AnyRef → Any
- val unix: TestAspectPoly
Runs only on Unix / Linux operating systems.
- def verify[R0, E0](condition: => ZIO[R0, E0, TestResult]): TestAspect[Nothing, R0, E0, Any]
Verifies the specified post-condition after each test is run.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- val windows: TestAspectPoly
Runs only on Windows operating systems.
- def withConfigProvider(configProvider: ConfigProvider): TestAspectPoly
An aspect that runs tests with the specified config provider.
- lazy val withLiveClock: TestAspectPoly
An aspect that runs tests with the live clock service.
- lazy val withLiveConsole: TestAspectPoly
An aspect that runs tests with the live console service.
- lazy val withLiveEnvironment: TestAspectPoly
An aspect that runs tests with the live default ZIO services.
- lazy val withLiveRandom: TestAspectPoly
An aspect that runs tests with the live random service.
- lazy val withLiveSystem: TestAspectPoly
An aspect that runs tests with the live system service.
- object PerTest
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- 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