ScenarioNetworkStore class

What the scenarios of one package recorded, on disk.

One file per exchange, and no index. flutter test runs test files concurrently, in separate processes, so a single index would be a read-modify-write race between them — and a recording that loses entries depending on how the runner scheduled the suite is not a recording. Two processes writing the same exchange write the same path, which is a last-writer-wins on identical bytes.

The body is a sibling file with the right extension, never a string inside the metadata. A committed recording is read in a diff, and a 5KB JSON response escaped into one line of a .json field is a recording nobody reviews.

Constructors

ScenarioNetworkStore(String directory)

Properties

directory → String
Where the files live. Absolute, or relative to the working directory — which both lanes set to the package root.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

keys() → List<String>
Every exchange the store holds, as METHOD url, in file order.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String method, Uri url) → ScenarioRecording?
What method url was recorded as, or null when nothing was.
toString() → String
A string representation of this object.
inherited
write(ScenarioRecording recording) → void
Writes recording, replacing whatever was there for the same exchange.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

keptHeader(String name) → bool
Whether a response header of this name belongs in a committed recording.