In general, you should never mock dart:io HTTP classes when working with Shelf. Shelf goes to great lengths to make apps built on it server-independent. By tightly coupling to dart:io in particular, you make it so that users can't run on any other server that may come along. It also makes testing much harder; you wouldn't need any mock classes if you could just test Redstone apps by passing shelf.Requests to a shelf.Handler and receiving shelf.Responses in return.
The most recent version of shelf uses
HttpHeaders.chunkedTransferEncoding
, which is not mocked by Redstone's mock class. This is causing test failures.In general, you should never mock
dart:io
HTTP classes when working with Shelf. Shelf goes to great lengths to make apps built on it server-independent. By tightly coupling todart:io
in particular, you make it so that users can't run on any other server that may come along. It also makes testing much harder; you wouldn't need any mock classes if you could just test Redstone apps by passingshelf.Request
s to ashelf.Handler
and receivingshelf.Response
s in return.