Use bundled sqlite driver for tests

pull/3279/head
Alex Baker 11 months ago
parent e979573e7e
commit ac9bb17f83

@ -2,6 +2,7 @@ package org.tasks.injection
import android.content.Context import android.content.Context
import androidx.room.Room import androidx.room.Room
import androidx.sqlite.driver.bundled.BundledSQLiteDriver
import dagger.Module import dagger.Module
import dagger.Provides import dagger.Provides
import dagger.hilt.InstallIn import dagger.hilt.InstallIn
@ -25,6 +26,7 @@ class TestModule {
@Singleton @Singleton
fun getDatabase(@ApplicationContext context: Context): Database { fun getDatabase(@ApplicationContext context: Context): Database {
return Room.inMemoryDatabaseBuilder(context, Database::class.java) return Room.inMemoryDatabaseBuilder(context, Database::class.java)
.setDriver(BundledSQLiteDriver())
.fallbackToDestructiveMigration(dropAllTables = true) .fallbackToDestructiveMigration(dropAllTables = true)
.build() .build()
} }

Loading…
Cancel
Save