I am writing a test case using jest there on a line i am getting error that cannot read property status of undefined

This is the line in my index file.

res.status(200).json(responseData);

In my test case file i am trying to declare this like

res = {
status:()=>{

}
}

But this didn’t work. Do anyone have any solution that how we can call declare function inside other function?