Ir al contenido principal
Versión: 5.2.x

Pitest

[Traducción Beta No Oficial]

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

La herramienta de Mutation Testing Pitest se integra con Kotest mediante un módulo de extensión.

Tras configurar Pitest, añade también el módulo io.kotest.extensions:kotest-extensions-pitest a tus dependencias:

    testImplementation("io.kotest.extensions:kotest-extensions-pitest:<version>")

Nota: Al ser pitest una extensión, utilizamos un grupo de Maven diferente (io.kotest.extensions) al de los módulos principales.

Después de esto, debemos indicar a Pitest que usaremos Kotest como testPlugin:

// Assuming that you have already configured the Gradle/Maven extension
configure<PitestPluginExtension> {
// testPlugin.set("Kotest") // needed only with old PIT <1.6.7, otherwise having kotest-extensions-pitest on classpath is enough
targetClasses.set(listOf("my.company.package.*"))
}

Con esto, todo debería quedar configurado y al ejecutar ./gradlew pitest se generarán los informes según hayas establecido.