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
It's still unclear to me how runInContext fixes the local references problem. In my project, I want to simulate input changes and count autocomplete calls.
Wouldn't runInContext create a new lodash instance? How would my component use that instance?
I realize I could pass debounce in as a function property, stub it out, and re-implement debounce, but the purpose of the black box test is to make sure nobody removes the debouncing logic in the future.
To fix the problem, I used the debounce npm package instead.
importdebouncefrom"debounce"
I hope this makes sense. Also, hopefully this will help others who search "sinon" and get confused about runInContext.
The text was updated successfully, but these errors were encountered:
I realize this has been asked twice:
It's still unclear to me how
runInContext
fixes the local references problem. In my project, I want to simulate input changes and count autocomplete calls.Wouldn't
runInContext
create a new lodash instance? How would my component use that instance?I realize I could pass
debounce
in as a function property, stub it out, and re-implement debounce, but the purpose of the black box test is to make sure nobody removes the debouncing logic in the future.To fix the problem, I used the
debounce
npm package instead.I hope this makes sense. Also, hopefully this will help others who search "sinon" and get confused about
runInContext
.The text was updated successfully, but these errors were encountered: