TestAspect

Companion:
class
class Object
trait Matchable
class Any

Type members

Classlikes

abstract class PerTest[+LowerR, -UpperR, +LowerE, -UpperE] extends TestAspect[LowerR, UpperR, LowerE, UpperE]
Companion:
object
object PerTest
Companion:
class

Value members

Concrete methods

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.

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.

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

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

Annotates tests with the specified test annotation.

Annotates tests with the specified test annotation.

def around[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.

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

def aroundAll[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.

Constructs an aspect that evaluates all tests between two effects, before and after, where the result of before can be used in 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 of before is not required by after.

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

def aroundTest[R0, E0](managed: ZManaged[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 managed function.

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

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.

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

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.

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.

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.

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

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.

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.

def dotty[LowerR, UpperR, LowerE, UpperE](that: TestAspect[LowerR, UpperR, LowerE, UpperE]): TestAspect[LowerR, UpperR, LowerE, UpperE]

An aspect that applies the specified aspect on Dotty.

An aspect that applies the specified aspect on Dotty.

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

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

def failing[E0](assertion: Assertion[TestFailure[E0]]): TestAspect[Nothing, Any, Nothing, E0]

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.

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.

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

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

def ifEnv(env: String, assertion: Assertion[String]): TestAspectAtLeastR[Live & Annotations]

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

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

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

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

def ifProp(prop: String, assertion: Assertion[String]): TestAspectAtLeastR[Live & Annotations]

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

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

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

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

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.

An aspect that applies the specified aspect 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.

An aspect that applies the specified aspect on the JVM.

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.

An aspect that applies the specified aspect on ScalaNative.

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

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

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

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

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

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

def repeat[R0 <: ZTestEnv & Annotations & Live](schedule: Schedule[R0, TestSuccess, Any]): TestAspectAtLeastR[R0]

An aspect that repeats successful tests according to a schedule.

An aspect that repeats successful tests according to a schedule.

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

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[R0](service: R0 => Restorable): TestAspectAtLeastR[R0]

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

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

def retry[R0 <: ZTestEnv & Annotations & Live, E0](schedule: Schedule[R0, TestFailure[E0], Any]): TestAspect[Nothing, R0, Nothing, E0]

An aspect that retries failed tests according to a schedule.

An aspect that retries failed tests according to a schedule.

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

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.

An aspect that applies the specified aspect on Scala 2.

def scala211[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.11.

An aspect that applies the specified aspect on Scala 2.11.

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.

An aspect that applies the specified aspect 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.

An aspect that applies the specified aspect on Scala 2.13.

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

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

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

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

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.

def tag(tag: String, tags: String*): TestAspectPoly

Annotates tests with string tags.

Annotates tests with string tags.

An aspect that times out tests using the specified duration.

An aspect that times out tests using the specified duration.

Value parameters:
duration

maximum test duration

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

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

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

Inherited methods

def timeoutWarning(duration: Duration): TestAspect[Nothing, Live, Nothing, Any]

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.

Inherited from:
TimeoutVariants

Concrete fields

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.

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.

An aspect that only runs tests on Dotty.

An aspect that only runs tests on Dotty.

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

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

An aspect that runs tests on all versions except Dotty.

An aspect that runs tests on all versions except Dotty.

An aspect that runs tests on all platforms except ScalaJS.

An aspect that runs tests on all platforms except ScalaJS.

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

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

An aspect that runs tests on all platforms except ScalaNative.

An aspect that runs tests on all platforms except ScalaNative.

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

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

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

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

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

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

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

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

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

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: TestAspect[Nothing, Annotations, Nothing, Any]

An aspect that records the state of fibers spawned by the current test in TestAnnotation.fibers. Applied by default in DefaultRunnableSpec and MutableRunnableSpec but not in RunnableSpec. This aspect is required for the proper functioning of TestClock.adjust.

An aspect that records the state of fibers spawned by the current test in TestAnnotation.fibers. Applied by default in DefaultRunnableSpec and MutableRunnableSpec but not in RunnableSpec. This aspect is required for the proper functioning of TestClock.adjust.

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

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

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

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

An aspect that returns the tests unchanged

An aspect that returns the tests unchanged

An aspect that marks tests as ignored.

An aspect that marks tests as ignored.

An aspect that only runs tests on ScalaJS.

An aspect that only runs tests on ScalaJS.

An aspect that only runs tests on the JVM.

An aspect that only runs tests on the JVM.

An aspect that only runs tests on ScalaNative.

An aspect that only runs tests on ScalaNative.

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

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

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

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

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

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

An aspect that only runs tests on Scala 2.11.

An aspect that only runs tests on Scala 2.11.

An aspect that only runs tests on Scala 2.12.

An aspect that only runs tests on Scala 2.12.

An aspect that only runs tests on Scala 2.13.

An aspect that only runs tests on Scala 2.13.

An aspect that only runs tests on Scala 2.

An aspect that only runs tests on Scala 2.

An aspect that executes the members of a suite sequentially.

An aspect that executes the members of a suite sequentially.

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.

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.

An aspect that converts ignored tests into test failures.

An aspect that converts ignored tests into test failures.

Annotates tests with their execution times.

Annotates tests with their execution times.