Expand my Community achievements bar.

Unit testing Javascript Use API

Avatar

Level 1

I have a use case where I am overlaying OOTB list component in AEM 6.2. and it's using Javascript Use API. and we have new components as well where we are using JavaScript Use API.

I have to write Unit test for these Script, Is there a way to test these scripts with proper mocking.

Anybody have any tips they could share on how they're unit testing Javascript Use-API Scripts?

Thanks!

2 Replies

Avatar

Level 9

Hi,

Javascript Sightly use API is server side javascript and you can have java unit cases which covers javascript too. Have you tried it? Or do you want to specific javascript test cases only?

Regards,

Jitendra

Avatar

Level 1

Hi Jitendra,

"Cover Javascript in Java Unit test case", Can you please share any example.

Thanks!

Regards,

Aman