failFast

fun TestConfig.failFast(maxFailureCount: Int): TestConfig(source)

Returns a test configuration which establishes a "fail fast" strategy on a TestElement hierarchy.

If more than maxFailureCount tests fail, any subsequent test will abandon further testing:

  • On platforms supporting it, the test session stops, optionally marking all remaining tests as skipped.

  • On platforms not supporting a premature shutdown, all remaining tests will fail with a FailFastException, without being executed.

The strategy covers the TestElement it is configured for and all elements below it.