When true, the next upload call fails with a NetworkFailure
instead of succeeding, then resets to false. Lets a test exercise
the upload-failure path (e.g. sendAttachment marking the optimistic
bubble failed) without a bespoke fake.
Mints the id upload answers with, given the 1-based call number.
null (default) answers mock-attachment-1 for every call, so a
single-upload test can hardcode it. Set
(n) => 'mock-attachment-$n' when the test needs consecutive uploads
to be distinguishable.
How many times upload has been called, failures included. Lets a
test assert that a path which re-posts an already-uploaded blob — a
retrySend on an attachment whose send failed — does not upload the
bytes a second time.
MIME type of every upload call, in order. Lets a test assert that a
path uploading more than one blob — sendAttachment on a video, which
posts the clip and then its poster frame — sent the right payloads.