Skip to content

Convert instrumentation tests to unit tests where possible #40

Open
@mahozad

Description

@mahozad

This makes the tests a lot easier and faster to run.
We can use Robolectric (at the time of writing this, it does not support JUnit 5).

If you want to run Robolectric tests with Junit 4 (using @RunWith and @org.junit.Test etc), remember to include testImplementation("org.junit.vintage:junit-vintage-engine:5.7.2") dependency in the build script.

Remeber to delete the excludeEngines("junit-vintage") from the following block of code in piechart build script so we can run JUnit 4 tests as well with the vintage engine (why was it excluded in the first place?):

useJUnitPlatform {
     excludeEngines("junit-vintage")
 }

See this and this for an example.

  • Remember to update the GitHub workflows as well

Metadata

Metadata

Assignees

Labels

testsRelated to library tests

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions