Unit Testing Jetpack Datastore
Jetpack DataStore is a popular and powerful data storage solution for Android apps. It allows us to store either key-value pairs, or strongly typed objects with protocol buffer. In this article, we will explore how to test our DataStore.
Setup
Kotlin...
blog.amalhanaja.dev5 min read
Andy O'Brien
Hey this is awesome, it came in handy so that I didn't have to run instrumentation tests to test with datastore.
However, i got stuck on this for longer than I should have. On the temporary folder creation append
.apply { create() }to the end of the builder. Otherwise the folder wont be created when DataStore tries to produce the file.