Skip to content
🤔 Documentation issue? Report it

//leakcanary/leakcanary/DetectLeaksAfterTestSuccess

DetectLeaksAfterTestSuccess

class DetectLeaksAfterTestSuccess(tag: String = DetectLeaksAfterTestSuccess::class.java.simpleName) : TestRule

TestRule that invokes LeakAssertions.assertNoLeaks after the test successfully evaluates. Pay attention to where you set up this rule in the rule chain as you might detect different leaks (e.g. around vs wrapped by the activity rule). It’s also possible to use this rule several times in a rule chain.

This rule automatically applies the TestDescriptionHolder rule.

Constructors

DetectLeaksAfterTestSuccess fun DetectLeaksAfterTestSuccess(tag: String = DetectLeaksAfterTestSuccess::class.java.simpleName)

Types

Name Summary
Companion object Companion

Functions

Name Summary
apply open override fun apply(base: Statement, description: Description): Statement