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
Note: most of this wouldn't be an issue depending on the results of #241
Say I have a test:
defsetupdoTesla.Mock.mock(fn-># lots of mocksend)end# lots of teststest"a new thing"doTesla.Mock.mock(fn-># a mock to override a previously defined one# (to test a different response for the same request,# like an error)end)# Now all of my mocks from `setup` are goneend
I don't know what the API would look like but I have two ideas to not break existing tests:
Option 1:
defsetupdo# `mock` now returns a collection of all mocksTesla.Mock.mock(fn-># lots of mocksend)end# lots of teststest"a new thing",context_mocksdoTesla.Mock.mock(context_mocks,fn-># a mock to override a previously defined one# (to test a different response for the same request,# like an error)end)# Now all of my mocks from `setup` are still there, but one of them is overridden with a newer mockend
Option 2:
defsetupdo# no change to `mock`Tesla.Mock.mock(fn-># lots of mocksend)end# lots of teststest"a new thing"doTesla.Mock.add_mock(fn-># a mock to override a previously defined one# (to test a different response for the same request,# like an error)end)# Now all of my mocks from `setup` are still there, but one of them is overridden with a newer mockend
Thoughts? 😅
The text was updated successfully, but these errors were encountered:
Note: most of this wouldn't be an issue depending on the results of #241
Say I have a test:
I don't know what the API would look like but I have two ideas to not break existing tests:
Option 1:
Option 2:
Thoughts? 😅
The text was updated successfully, but these errors were encountered: