Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

76
Views
Automated testing for JavaScript code executed by Nashorn

At my job we use a platform written in Java with business logic mostly written in JavaScript and executed by Nashorn (I think it could be Rhino or GraalVM as well). This decision was justified by the ability to dynamically update business domain metadata and GUI forms on client.

This JS code is located both in separate .js files and inside tags in .xml files. XML files contain GUI form descriptions for the custom Swing GUI engine, and JS in XML tags is used for the form elements handlers.

The problem is none of this JS code has automated tests.

I'm not experienced in automated testing, I used only JUnit a couple of times, and I don't understand if it's possible to test such JS code at all.

Have anyone of you ever written automated tests for the code which is executed from some other code? Is it possible (especially as a Maven task), and if it is - how one can do it?

I've searched for examples but couldn't find anything to point the direction.

Also: is it possible to debug such code some other way than console.log() and searching/grepping in logs? I understand that it is another question but for me both of them are parts of the same problem because without tests every change that involves some data manipulation ends with the initial code covered with console.log() which I then remove before commit.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!