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
I'm having a hard time figuring out if record mode works like Sepia's cache mode or not (reuse existing playbacks, but record any new requests).
If I disable my network connection and run my tests in play mode, they all pass because the playbacks all exist. But if I run in record mode with no network, and my tests don't make any new requests (again, the playbacks all exist), it just stalls. So what is record actually doing in this situation: using the playbacks, or not? The docs make it sound like it should be using them, but then it should pass with no network if the same HTTP requests are being made…
The text was updated successfully, but these errors were encountered:
Here's a simple test I just tried out that makes me think this behavior doesn't make sense:
In a test, make an HTTP request and use t.snapshot to snapshot the response body. Run with AVA_PLAYBACK=record ava -u. A snapshot and playback should be saved.
Now edit the playback file to have a different response body.
Running AVA_PLAYBACK=play ava fails as expected (the response body in the playback is returned, and compared with the snapshot, and they no longer match).
Strangely, AVA_PLAYBACK=record ava (note no -u) succeeds. The actual live HTTP response from the network is returned and compared with the snapshot (and they match), the playback isn't used. That's a little weird given what the docs say, but it might make sense to do – BUT the playback also isn't updated – it still has the edited response body. I'd expect either (1) the test fails because the playback is used (no new requests were made in the test) or (2) the test succeeds and the playback is updated (undoing our edited response body).
This is causing me issues currently – I'll write new tests, run AVA_PLAYBACK=record ava -u, and existing snapshots are updated (due to frequently-changing values in the response) but out of sync with the playbacks, which don't get updated.
I'm having a hard time figuring out if
record
mode works like Sepia'scache
mode or not (reuse existing playbacks, but record any new requests).If I disable my network connection and run my tests in
play
mode, they all pass because the playbacks all exist. But if I run inrecord
mode with no network, and my tests don't make any new requests (again, the playbacks all exist), it just stalls. So what isrecord
actually doing in this situation: using the playbacks, or not? The docs make it sound like it should be using them, but then it should pass with no network if the same HTTP requests are being made…The text was updated successfully, but these errors were encountered: