Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

78
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda