Skip to content

Commit 0d557cb

Browse files
automatic teardown of server
1 parent f42b9a8 commit 0d557cb

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/powersync/test/connected_test.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ void main() {
2727
createTestServer() async {
2828
final testServer = TestHttpServerHelper();
2929
await testServer.start();
30+
addTearDown(() => testServer.stop());
3031
return testServer;
3132
}
3233

3334
test('should connect to mock PowerSync instance', () async {
3435
final testServer = await createTestServer();
35-
// Cant do this inside the createTestServer function unfortunately
36-
addTearDown(() => testServer.stop());
37-
3836
final connector = TestConnector(() async {
3937
return PowerSyncCredentials(
4038
endpoint: testServer.uri.toString(),
@@ -70,9 +68,6 @@ void main() {
7068
int uploadCounter = 0;
7169
Completer uploadTriggeredCompleter = Completer();
7270
final testServer = await createTestServer();
73-
// Cant do this inside the createTestServer function unfortunately
74-
addTearDown(() => testServer.stop());
75-
7671
final connector = TestConnector(() async {
7772
return PowerSyncCredentials(
7873
endpoint: testServer.uri.toString(),

0 commit comments

Comments
 (0)