Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

HTTP mocks are broken against the latest Shelf version #193

Open
nex3 opened this issue Oct 26, 2016 · 1 comment
Open

HTTP mocks are broken against the latest Shelf version #193

nex3 opened this issue Oct 26, 2016 · 1 comment

Comments

@nex3
Copy link

nex3 commented Oct 26, 2016

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 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.

@sestegra
Copy link
Contributor

sestegra commented Oct 30, 2016

Fixed by #194

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants