// Code for Timer Function//
Function startTimer (event)
{
var session Timeout=
setTimeout (function ()
{
Self.postMessage (
{
Message:'show dialog'
};
);
}, event.duration);
}
How to write test case for this ?
Refer Timer mocks available in Jest
https://jestjs.io/docs/timer-mocks