Skip to content

Commit 113efbe

Browse files
Port android test stubs to capacitor 5, and exclude them from npm package (#307)
* fixe ExampleInstrumentedTest so it compiles * dont package android tests
1 parent bbeb8f9 commit 113efbe

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.getcapacitor.android;
22

33
import android.content.Context;
4-
import android.support.test.InstrumentationRegistry;
5-
import android.support.test.runner.AndroidJUnit4;
4+
import androidx.test.platform.app.InstrumentationRegistry;
5+
import androidx.test.runner.AndroidJUnit4;
66

77
import org.junit.Test;
88
import org.junit.runner.RunWith;
@@ -19,7 +19,7 @@ public class ExampleInstrumentedTest {
1919
@Test
2020
public void useAppContext() throws Exception {
2121
// Context of the app under test.
22-
Context appContext = InstrumentationRegistry.getTargetContext();
22+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
2323

2424
assertEquals("com.getcapacitor.android", appContext.getPackageName());
2525
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"dist/",
3333
"ios/",
3434
"android/",
35+
"!android/src/androidTest",
36+
"!android/src/test",
3537
"CodetrixStudioCapacitorGoogleAuth.podspec"
3638
],
3739
"keywords": [
@@ -62,4 +64,4 @@
6264
"url": "https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues"
6365
},
6466
"prettier": "@ionic/prettier-config"
65-
}
67+
}

0 commit comments

Comments
 (0)