My component is as follows
import {myMethod} from "./myFile"
function MyComponent(){
const output = myMethod();
console.log({output})
return <div></div>
}
And i am stubbing myMethod because I want it to return a specific value like so
import * as Parent from "./myFile"
cy.stub(Parent, "myMethod", () => "i was stubbed")
cy.visit("/my_component") # Does not use the stubbed function
but then i am finding that the component still uses the original function and not the stubbed function, does anyone know what i am doing wrong?