Running unit tests with Robolectric instead of starting up emulator every time

This commit is contained in:
Mary Tran 2018-10-08 16:25:15 -04:00
parent 8ecd089fe3
commit 5a382baab4
3 changed files with 29 additions and 10 deletions

View file

@ -16,6 +16,11 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
dependencies {
@ -24,10 +29,14 @@ dependencies {
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.0-alpha-3-SNAPSHOT'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.jaredrummler:material-spinner:1.2.5'
implementation 'com.android.support:design:28.0.0-alpha3'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}