Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

77
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda