From b59ddea3b6439b236fd10b731ec5786c801d50c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Fri, 1 Aug 2025 11:36:29 +0800 Subject: [PATCH] =?UTF-8?q?FEAT=20=3D>=20=E6=9C=AC=E6=AC=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=A1=B9=E7=9B=AE=E4=B8=BA=EF=BC=9A=20=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=9E=84=E5=BB=BAapp=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nkebao/android/app/gradle.properties | 8 +----- .../myapp/ExampleInstrumentedTest.java | 26 ------------------- .../getcapacitor/myapp/ExampleUnitTest.java | 18 ------------- nkebao/android/gradle.properties | 5 ++-- 4 files changed, 4 insertions(+), 53 deletions(-) delete mode 100644 nkebao/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java delete mode 100644 nkebao/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java diff --git a/nkebao/android/app/gradle.properties b/nkebao/android/app/gradle.properties index 43ebbdf43..ed62cff0d 100644 --- a/nkebao/android/app/gradle.properties +++ b/nkebao/android/app/gradle.properties @@ -1,8 +1,2 @@ -# 禁用所有测试 -android.enableUnitTestBinaryResources=false -android.enableAndroidTestBinaryResources=false +# 禁用测试 android.testInstrumentationRunner=androidx.test.runner.AndroidJUnitRunner - -# 跳过测试任务 -android.testOptions.unitTests.all.enabled=false -android.testOptions.androidTest.enabled=false \ No newline at end of file diff --git a/nkebao/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java b/nkebao/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java deleted file mode 100644 index f2c2217ef..000000000 --- a/nkebao/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.getcapacitor.myapp; - -import static org.junit.Assert.*; - -import android.content.Context; -import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.test.platform.app.InstrumentationRegistry; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Instrumented test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - - @Test - public void useAppContext() throws Exception { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - - assertEquals("com.getcapacitor.app", appContext.getPackageName()); - } -} diff --git a/nkebao/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java b/nkebao/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java deleted file mode 100644 index 029732784..000000000 --- a/nkebao/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.getcapacitor.myapp; - -import static org.junit.Assert.*; - -import org.junit.Test; - -/** - * Example local unit test, which will execute on the development machine (host). - * - * @see Testing documentation - */ -public class ExampleUnitTest { - - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} diff --git a/nkebao/android/gradle.properties b/nkebao/android/gradle.properties index 4de7c2a43..8d4fbb24a 100644 --- a/nkebao/android/gradle.properties +++ b/nkebao/android/gradle.properties @@ -23,5 +23,6 @@ android.useAndroidX=true # 禁用测试 android.testInstrumentationRunner=androidx.test.runner.AndroidJUnitRunner -android.enableUnitTestBinaryResources=false -android.enableAndroidTestBinaryResources=false + +# 禁用实验性测试选项 +android.experimental.testOptions.emulatorSnapshots.maxSnapshotsForTestFailures=0