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
In many cases, spies are re-useable, so they can be set up at the root of the test.
When asserting cases where a spy may or may not have been called, the spy's state needs to be re-set between cases (via afterEach).
At current, it seems the only way to effectively re-set a testdouble spy/stub's state is to overwrite the whole thing with a fresh spy, which creates a daisy-chain of make-work: that spy is likely being fed into a module replacement, so now the module has to be needlessly replaced every time the spy/stub is re-set.
The text was updated successfully, but these errors were encountered:
In many cases, spies are re-useable, so they can be set up at the root of the test.
When asserting cases where a spy may or may not have been called, the spy's state needs to be re-set between cases (via
afterEach
).At current, it seems the only way to effectively re-set a testdouble spy/stub's state is to overwrite the whole thing with a fresh spy, which creates a daisy-chain of make-work: that spy is likely being fed into a module replacement, so now the module has to be needlessly replaced every time the spy/stub is re-set.
The text was updated successfully, but these errors were encountered: