1.1.0-alpha+1

This commit is contained in:
Tobe O 2017-11-18 00:04:42 -05:00
parent 8d3c08fb2d
commit 68a33030e5
3 changed files with 9 additions and 3 deletions

View file

@ -23,7 +23,7 @@ final Uuid _uuid = new Uuid();
Future<TestClient> connectTo(Angel app,
{Map initialSession, bool autoDecodeGzip: true}) async {
if (!app.isProduction)
app.properties.putIfAbsent('testMode', () => true);
app.configuration.putIfAbsent('testMode', () => true);
for (var plugin in app.startupHooks)
await plugin(app);
@ -52,7 +52,10 @@ class TestClient extends client.BaseAngelClient {
TestClient(this.server, {this.autoDecodeGzip: true}) : super(new http.Client(), '/');
Future close() => server.close();
Future close() {
this.client.close();
return server.close();
}
/// Opens a WebSockets connection to the server. This will automatically bind the server
/// over HTTP, if it is not already listening. Unfortunately, WebSockets cannot be mocked (yet!).

View file

@ -2,7 +2,7 @@ author: "Tobe O <thosakwe@gmail.com>"
description: "Testing utility library for the Angel framework."
homepage: "https://github.com/angel-dart/test.git"
name: "angel_test"
version: 1.1.0-alpha
version: 1.1.0-alpha+1
dependencies:
angel_client: ^1.1.0-alpha
angel_framework: ^1.1.0-alpha

View file

@ -48,6 +48,8 @@ main() {
await app.configure(ws.configureServer);
app.all('/ws', ws.handleRequest);
app.errorHandler = (e, req, res) => e.toJson();
client = await connectTo(app);
});
@ -71,6 +73,7 @@ main() {
test('isAngelHttpException', () async {
var res = await client.get('/error');
print(res.body);
expect(res, isAngelHttpException());
expect(
res,