Unit Tests

20 views
Skip to first unread message

aj...@cogniance.com

unread,
May 23, 2016, 10:16:19 PM5/23/16
to MynaJS-General
Hi. I'm currently supporting project that uses MynaJS as it's core. And I can't find proper way to write unit tests for it. Extended javascript objects can't be used with help of usual nodejs testing frameworks. Some Java classes also can't be mocked as they used everywhere as global  objects. Is there any best practice for MynaJS? Is it alive at all?

Mark Porter

unread,
May 23, 2016, 10:40:36 PM5/23/16
to MynaJS-General
There are a few options. You can use the commandline and wire it up with any commandline unit frameowrk (/WEB-INF/myna/commandline/myna).

You can also use generic assertion/frameworks like expect.js or jsunit (see http://localhost:8180/dev/myna/tests/)

I have an node-style require framework and test suite I have been playing with, but I haven't ported to Myna yet. I'm still trying to decide if Nashorn is really worth the effort or if I should just back port some of that code to regular Myna.

aj...@cogniance.com

unread,
May 24, 2016, 10:13:07 AM5/24/16
to MynaJS-General
Thank you. I'll try them.
Reply all
Reply to author
Forward
0 new messages