diff --git a/quickjs-android-wrapper/src/androidTest/java/com/whl/quickjs/wrapper/QuickJSTest.java b/quickjs-android-wrapper/src/androidTest/java/com/whl/quickjs/wrapper/QuickJSTest.java index 6b0f634..908bf15 100644 --- a/quickjs-android-wrapper/src/androidTest/java/com/whl/quickjs/wrapper/QuickJSTest.java +++ b/quickjs-android-wrapper/src/androidTest/java/com/whl/quickjs/wrapper/QuickJSTest.java @@ -800,6 +800,20 @@ public void testPromiseUnhandledRejections10() { context.destroyContext(); } + @Test + public void testPromiseUnhandledRejections11() { + thrown.expect(QuickJSException.class); + thrown.expectMessage("bad"); + + QuickJSContext context = QuickJSContext.create(); + context.evaluate("new Promise((resolve, reject) => {\n" + + " resolve();\n" + + "}).then(() => {\n" + + " throw new Error('bad');\n" + + "});"); + context.destroyContext(); + } + // todo fix // @Test // public void testJSArraySetParseJSON() {