You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys Im having a weird problem where my component receive a function parameter as undefined if: It is not declared in the same scope
OR I don't declare and pass other variables on the same scope
describe('myTest',()=>{letmyComponentbeforeEach(()=>{letmyMock=jest.fn()// declared on the same blockmyComponent=shallow(<MyComponentaction={myMock}/>)})})
WORKS this.props.action is my mock
describe('myTest',()=>{letmyComponentletmyMockbeforeEach(()=>{myMock=jest.fn()letanything='anything'// anything else declared and passed in the same blockmyComponent=shallow(<MyComponentaction={myMock}anything={anything}/>)})})
Hi guys Im having a weird problem where my component receive a function parameter as undefined if:
It is not declared in the same scope
OR
I don't declare and pass other variables on the same scope
FAIL this.props.action is undefined
WORKS this.props.action is my mock
WORKS this.props.action is my mock
my deps:
any ideas?
thanks
The text was updated successfully, but these errors were encountered: