Merge pull request #246 from PatOConnor43/fix-test

Bind the decoder to req.body
This commit is contained in:
Tobe Osakwe 2019-10-09 14:20:13 -04:00 committed by GitHub
commit 264dd4dc91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -113,7 +113,7 @@ main() {
}, optional: ['bar']));
var rq = MockHttpRequest('GET', Uri(path: 'foo'));
await AngelHttp(app).handleRequest(rq);
var body = await rq.response.transform(utf8.decoder).join();
var body = await utf8.decoder.bind(rq.response).join();
expect(json.decode(body), 2);
});

View file

@ -28,7 +28,7 @@ main() {
app.container.registerSingleton(Todo(text: TEXT, over: OVER));
app.container.registerFactory<Future<Foo>>((container) async {
var req = container.make<RequestContext>();
var text = await req.body.transform(utf8.decoder).join();
var text = await utf8.decoder.bind(req.body).join();
return Foo(text);
});