Skip to content

Commit

Permalink
Port android test stubs to capacitor 5, and exclude them from npm pac…
Browse files Browse the repository at this point in the history
…kage (#307)

* fixe ExampleInstrumentedTest so it compiles

* dont package android tests
  • Loading branch information
adamschoenemann authored Oct 9, 2023
1 parent bbeb8f9 commit 113efbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.getcapacitor.android;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

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

assertEquals("com.getcapacitor.android", appContext.getPackageName());
}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"dist/",
"ios/",
"android/",
"!android/src/androidTest",
"!android/src/test",
"CodetrixStudioCapacitorGoogleAuth.podspec"
],
"keywords": [
Expand Down Expand Up @@ -62,4 +64,4 @@
"url": "https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues"
},
"prettier": "@ionic/prettier-config"
}
}

0 comments on commit 113efbe

Please sign in to comment.