From e8a46d580434e083a1f4a99241c5159042d382c5 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Thu, 18 Oct 2018 19:00:55 -0400 Subject: [PATCH] Fixed --- test/generic_test.dart | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/generic_test.dart b/test/generic_test.dart index 1fc3e9e0..a060ac56 100644 --- a/test/generic_test.dart +++ b/test/generic_test.dart @@ -21,8 +21,8 @@ wireHooked(HookedService hooked) { main() { group('Generic Tests', () { - Angel app = new Angel(); - AngelHttp transport = new AngelHttp(app); + Angel app; + AngelHttp transport; http.Client client; Db db = new Db('mongodb://localhost:27017/angel_mongo'); DbCollection testData; @@ -30,11 +30,13 @@ main() { HookedService, MongoService> greetingService; setUp(() async { + app = new Angel(); + transport = new AngelHttp(app); client = new http.Client(); await db.open(); testData = db.collection('test_data'); // Delete anything before we start - await testData.remove({}); + await testData.remove({}); var service = new MongoService(testData, debug: true); greetingService = new HookedService(service); @@ -48,7 +50,7 @@ main() { tearDown(() async { // Delete anything left over - await testData.remove({}); + await testData.remove({}); await db.close(); await transport.close(); client = null; @@ -63,7 +65,8 @@ main() { response = await client.get("$url/api"); expect(response.statusCode, isIn([200, 201])); - List users = god.deserialize(response.body); + List users = + god.deserialize(response.body, outputType: [].runtimeType); expect(users.length, equals(1)); }); @@ -130,7 +133,7 @@ main() { var response = await client.get("$url/api?to=world"); print(response.body); - List queried = god.deserialize(response.body); + List queried = god.deserialize(response.body, outputType: [].runtimeType); expect(queried.length, equals(1)); expect(queried[0].keys.length, equals(2)); expect(queried[0]["id"], equals(world["id"]));