Skip to content


sharedTest pattern: sharing tests and speeding up development

After Robolectric's 4.0 release, Robolectric supports the AndroidJUnit4 test runner, ActivityScenario, and Espresso for interacting with UI components. As we know, we also can run those tests with an official emulator. This article will show an often overlooked but widely-used pattern called sharedTest to share tests between local and instrumentation tests. This will provide the benefit of fast unit testing while ensuring that tests are high-fidelity by enabling them to be run in an emulator.

A memorial tribute for Jonathan Gerrish

In late August, 2021, we were incredibly saddened to learn of the tragic passing of Jonathan Gerrish and his family while they were hiking near Mariposa, CA. Jonathan was a long-time Robolectric maintainer and active contributor since 2014. He saw incredible potential in Robolectric and championed it within Google, elevating it to an officially supported testing tool that grew to be used by tens of thousands of Android developers.