Jacoco with Robolectric , coverage is zero

9 views
Skip to first unread message

weijian ni

unread,
Nov 4, 2021, 6:06:22 AM11/4/21
to JaCoCo and EclEmma Users
In Android module,the test dir, 
code like this:
@RunWith(RobolectricTestRunner.class)
public class UserTest {
         @Test
         public void user() {
                     User user = new User(2, "aaa", 1, "");
                     assertEquals(2, user.getUserId());
          }
}

run jacoco, coverage is zero, but when remove “@RunWith(RobolectricTestRunner.class)”, the coverage  is ok,why?how can fix it?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages