Skip to content

Commit ef52eda

Browse files
authored
Migrate test/fixtures/server.dart to null-safety (#1697)
1 parent c25ff11 commit ef52eda

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

dwds/test/fixtures/server.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart = 2.9
6-
75
import 'dart:io';
86

97
import 'package:build_daemon/data/build_status.dart' as daemon;
@@ -66,7 +64,7 @@ class TestServer {
6664

6765
static Future<TestServer> start(
6866
String hostname,
69-
int port,
67+
int? port,
7068
Handler assetHandler,
7169
AssetReader assetReader,
7270
RequireStrategy strategy,
@@ -78,10 +76,10 @@ class TestServer {
7876
bool autoRun,
7977
bool enableDebugging,
8078
bool useSse,
81-
UrlEncoder urlEncoder,
82-
ExpressionCompiler expressionCompiler,
79+
UrlEncoder? urlEncoder,
80+
ExpressionCompiler? expressionCompiler,
8381
bool spawnDds,
84-
ExpressionCompilerService ddcService,
82+
ExpressionCompilerService? ddcService,
8583
) async {
8684
var pipeline = const Pipeline();
8785

@@ -122,6 +120,9 @@ class TestServer {
122120
enableStdinCommands: false,
123121
customDevToolsPath: devToolsPath,
124122
);
123+
if (server == null) {
124+
throw StateError('DevTools server could not be started.');
125+
}
125126
return DevTools(server.address.host, server.port, server);
126127
}
127128
: null);

0 commit comments

Comments
 (0)