diff --git a/lib/src/client.dart b/lib/src/client.dart index c8fdfce5..0b5b81a0 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -23,7 +23,7 @@ final Uuid _uuid = new Uuid(); Future 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!). diff --git a/pubspec.yaml b/pubspec.yaml index 42e39ff7..841332ab 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ author: "Tobe O " 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 diff --git a/test/simple_test.dart b/test/simple_test.dart index 8b6caa13..5bf6e161 100644 --- a/test/simple_test.dart +++ b/test/simple_test.dart @@ -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,