connectTo function
Shorthand for bootstrapping a TestClient.
Implementation
Future<TestClient> connectTo(Angel app,
{Map? initialSession,
bool autoDecodeGzip = true,
bool useZone = false}) async {
print('Load configuration');
if (!app.environment.isProduction) {
app.configuration.putIfAbsent('testMode', () => true);
}
for (var plugin in app.startupHooks) {
print('Load plugins');
await plugin(app);
}
return TestClient(app,
autoDecodeGzip: autoDecodeGzip != false, useZone: useZone)
..session.addAll(initialSession ?? {});
}