Monday, March 12, 2018

Re: Testing native @JsType in GWT tests

On Monday, March 12, 2018 at 9:17:58 AM UTC+1, Mincong Huang wrote:
Thanks, Thomas. Changing to production mode fixed the problem.

However, I noticed that when using production mode in tests, I cannot test the type-matching for JSNI anymore. Previously, the GWT generated interface code caught the problem at runtime in development mode. When running in production mode, we will not see an exception. JavaScript's dynamic typing obscures this kind of problem.

public static native int badExample() /*-{ return "Not A Number"; }-*/;

I'd suggest you use -ea and -draftCompile for your tests (checkAssertions and draftCompile in the POM). Hopefully that would catch more of such bugs… (-draftCompile will also speed them up)

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment