Open jamesarosen opened 9 years ago
Or would that mess with the library's ability to record?
@jamesarosen the biggest reason that it doesn't do that right now is that it allows the recorder to memoize recordings from other steps. So for instance if your app requests /users for every test, having it not restart means that we can then only make one request to the server while recording. It also means that you have better guarantees, if the request changes during recording, a newer result won't clobber an old one.
I've long since forgotten my original reason for writing this. I wonder if I meant to do the stop and restart only in playback mode.
Currently, this library starts the server before the suite run and stops it after.
That leads to the situation where
server.responses
andserver.requests
have shared state from test to test. That, in turn, makes it harder to make assertions about requests and responses and makes it easy to accidentally have one test step on another by defining a fake response.What do you think of changing the above lines to the following?