None of the above.
JWebUnit is based on HttpUnit. I haven't used HtmlUnit, but the documentation provides says it provides partial support for JavaScript.
The essence of the problem is that these tools are simulating the browser. And since browsers all implement javascript differently, you aren't really
testing how the code will behave. To truly test JavaScript, you can use a tool that runs in a browser like JSUnit or Selenium.