Hellow expert,
I am writting unit test for my application and I Need help to mock useState in Jest.
function App() {
const [myFlag, setMyflag] = useState(false);
}
In test i want to change value of myFlag to true.
Tried with multiple option one of this is
jest.spyOn(React, ‘useState’).mockReturnValueOnce([myFlag, jest.fn()]);