I am in the process of unit testing a function using Jest that merely passes on its parameters to another function by calling it and has no return.
I have googled and tried a bunch of suggested mock implementations, but can't seem to get it to work.
Imported File:
export const firstFunc = (dataObj) => {
secondFunc('anything', dataObj)
}
export const secondFunc = (str, dataObj) => {
// Does something with the dataObj but also doesn't return anything.
}
Essentially what I want to test for is that firstFunc
calls secondFunc
, but am not able to get it to work.
Thank you in advance. Also, open to suggestions for any other tests that I could run in this situation.