apply from: "${project.projectDir}/../div-tests-coverage.gradle"
apply plugin: 'kotlin-android'

android {
    defaultConfig {
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    }

    testOptions {
        unitTests {
            //noinspection ConfigurationAvoidance
            all {
                jacoco {
                    includeNoLocationClasses = true
                    excludes = ['jdk.internal.*']
                }

                jvmArgs '-noverify'

                testLogging {
                    events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
                }

                // Keep it synced with DivKitGlobalConfigProvider.
                systemProperty 'robolectric.looperMode', "LEGACY"
            }
            includeAndroidResources = true
        }
    }
}

dependencies {
    testImplementation libs.androidx.test.core
    testImplementation(libs.junit) {
        exclude group: "org.hamcrest", module: "hamcrest-core"
    }
    testImplementation libs.hamcrest.junit
    testImplementation libs.mockito.core
    testImplementation libs.mockito.kotlin
    testImplementation libs.robolectric
    testImplementation libs.fest.reflect
    testImplementation(libs.fest.android) {
        exclude module: "support-v4"
    }
    testImplementation libs.kotlin.corountines.test
}
