Skip to content

Commit f8a21f1

Browse files
committed
Fixed exception message check
1 parent 546cf8f commit f8a21f1

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ bin/
2222
.classpath
2323
android-runtime.iml
2424
test-app/build-tools/*.log
25+
test-app/analytics/build-statistics.json

test-app/app/src/main/assets/app/tests/exceptionHandlingTests.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ describe("Tests exception handling ", function () {
302302
errMsg = e.toString();
303303
}
304304
expect(exceptionCaught).toBe(true);
305-
expect(errMsg).toBe("Error: Unknown error. Cannot get error message.");
305+
expect(errMsg).toBe("Error: com.tns.tests.ExceptionHandlingTest$BadException");
306306
});
307307

308308
it("should successfully catch syntax errors", function () {
@@ -320,18 +320,18 @@ describe("Tests exception handling ", function () {
320320
expect(errMsg).toContain("File: (file:///data/data/com.tns.testapplication/files/app/tests/syntaxErrors.js:3:4)");
321321
});
322322

323-
// run this test only for API level bigger than 25 as we have handling there
324-
if(android.os.Build.VERSION.SDK_INT > 25 && android.os.Build.CPU_ABI != "x86" && android.os.Build.CPU_ABI != "x86_64") {
325-
it("Should handle SIGABRT and throw a NativeScript exception when incorrectly calling JNI methods", function () {
326-
let myClassInstance = new com.tns.tests.MyTestBaseClass3();
327-
// public void callMeWithAString(java.lang.String[] stringArr, Runnable arbitraryInterface)
328-
try {
329-
myClassInstance.callMeWithAString("stringVal", new java.lang.Runnable({ run: () => {} }))
330-
} catch (e) {
331-
android.util.Log.d("~~~~~", "~~~~~~~~ " + e.toString());
332-
333-
expect(e.toString()).toContain("SIGABRT");
334-
}
335-
});
336-
}
323+
// run this test only for API level bigger than 25 as we have handling there
324+
if(android.os.Build.VERSION.SDK_INT > 25 && android.os.Build.CPU_ABI != "x86" && android.os.Build.CPU_ABI != "x86_64") {
325+
it("Should handle SIGABRT and throw a NativeScript exception when incorrectly calling JNI methods", function () {
326+
let myClassInstance = new com.tns.tests.MyTestBaseClass3();
327+
// public void callMeWithAString(java.lang.String[] stringArr, Runnable arbitraryInterface)
328+
try {
329+
myClassInstance.callMeWithAString("stringVal", new java.lang.Runnable({ run: () => {} }))
330+
} catch (e) {
331+
android.util.Log.d("~~~~~", "~~~~~~~~ " + e.toString());
332+
333+
expect(e.toString()).toContain("SIGABRT");
334+
}
335+
});
336+
}
337337
});

0 commit comments

Comments
 (0)