start static method

Future<NitroTestClient> start({
  1. Duration responseTimeout = const Duration(seconds: 5),
  2. bool responseTiming = true,
  3. bool exposeErrorDetails = false,
  4. int wsMaxBufferBytes = 1024 * 1024,
})

Starts a client over a fresh in-memory engine. No native library, no ports, no background threads beyond the runner's streams. A request or WebSocket handshake unanswered after responseTimeout throws StateError (there are no route timeouts here to do it). exposeErrorDetails and wsMaxBufferBytes mirror the ServerConfig fields of the same name.

Implementation

static Future<NitroTestClient> start({
  Duration responseTimeout = const Duration(seconds: 5),
  bool responseTiming = true,
  bool exposeErrorDetails = false,
  int wsMaxBufferBytes = 1024 * 1024,
}) async {
  final native = _InMemoryNative();
  final runner = ServerRunner(native)
    ..responseTimingForTesting = responseTiming
    ..exposeErrorDetailsForTesting = exposeErrorDetails
    ..wsMaxBufferBytesForTesting = wsMaxBufferBytes;
  return NitroTestClient._(runner, native, responseTimeout);
}