How to apply kapt { correctErrorTypes = true } to tests?

Works for the regular build but still getting “@error.NonExistentClass()” with tests.