Gradle Jacoco and JUnit5

后端 未结 4 756
抹茶落季
抹茶落季 2021-02-05 08:28

We just ported our unit tests to JUnit5. Realizing that this is still rather early adoption with little hints on google.

The most challenging was to get jacoco code cove

4条回答
  •  [愿得一人]
    2021-02-05 09:06

    To get a reference to the junitPlatformTest task, another option is to implement an afterEvaluate block in the project like this:

    afterEvaluate {
      def junitPlatformTestTask = tasks.getByName('junitPlatformTest')
    
      // do something with the junitPlatformTestTask
    }
    

    See my comments on GitHub for JUnit 5 for further examples.

提交回复
热议问题