Closed skitterm closed 3 months ago
Coverage variation | Diff coverage |
---|---|
:white_check_mark: +0.00% (target: -1.00%) | :white_check_mark: 100.00% (target: 80.00%) |
:rocket: Don’t miss a bit, follow what’s new on Codacy.
Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more
AP-4729
Why This Change?
Many folks (see #128) have had Cypress test runs error out when they add Chromatic. This is happening because if Chrome Devtools Protocol fails to send a method, we add an entry on the archives that has an
error
but nobody
. However, in Cypress we have been assuming all archive entries have a body, so when we bufferize the body, things error out.What Changed
body
-s. This rebufferize code was added when we were listening for Cypress resource requests client-side, so after sending to the server we needed to do aBuffer.from
on them. But since we are now using CDP with Cypress, we already bufferize the resourcebody
.Watcher
class (where we listen for the network and put things on the archive) toResourceArchiver
. This was to a) make clear what the class does and b) align this exported class name with the file name for consistency.How to test
@tevanoff @mea36 I really wanted to put in a test that covers this case (CDP sends error without breaking the entire test run), but I wasn't able to pin down what exactly was causing the CDP method to fail (there's the
error: invalid InterceptionId
that CDP hits, but I could not figure out how to reliably tell when it will happen). I spent 30 minutes trying to nail that down, but couldn't see how to set up a test in such a way that would recreate that issue, so I left off on that.