unit testing on custom widgets using Jest framework

86
1
03-16-2020 03:25 AM
Highlighted
New Contributor

Hi,

I would like to write unit testing on my custom widgets using Jest framework.my custom widget consumes dojo,esri libraries.for example 'esri/tasks/query','esri/tasks/QueryTask', 'dojo/promise/all','dojo/when','dojo/Deferred' etc.
my first question is, is it possible to do custom widget unit testing with Jest framework? if so, can you please send me a basic jest sample? any help is greatly appreciated.

Regards,

Sandhya

Reply
0 Kudos
1 Reply
Highlighted
New Contributor

Hi ,

Here is my update on this topic.

I have pulled the functions out of define by passing all required params as arguments. started writing unit tests in jest by mocking the libs/objects.

Regards,

Sandhya

Reply
0 Kudos