Creates an instance that targets the configured app.
Source
TestClient(Application app) {
if (app.server == null) {
throw new TestClientException(
"TestClient failed to initialize from Application. "
"Start the application prior to instantiating a TestClient and ensure that the "
"application is run with `runOnMainIsolate: true`. You may also create a TestClient "
"without an Application through its named constructors.");
}
var scheme = app.server.requiresHTTPS ? "https" : "http";
var host = "localhost";
var port = app.configuration.port;
if (port == 0) {
port = app.mainIsolateSink.server.server.port;
}
baseURL = "$scheme://$host:$port";
}