Skip to content

Commit

Permalink
automatic teardown of server
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensJourney committed Oct 30, 2024
1 parent f42b9a8 commit 0d557cb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/powersync/test/connected_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ void main() {
createTestServer() async {
final testServer = TestHttpServerHelper();
await testServer.start();
addTearDown(() => testServer.stop());
return testServer;
}

test('should connect to mock PowerSync instance', () async {
final testServer = await createTestServer();
// Cant do this inside the createTestServer function unfortunately
addTearDown(() => testServer.stop());

final connector = TestConnector(() async {
return PowerSyncCredentials(
endpoint: testServer.uri.toString(),
Expand Down Expand Up @@ -70,9 +68,6 @@ void main() {
int uploadCounter = 0;
Completer uploadTriggeredCompleter = Completer();
final testServer = await createTestServer();
// Cant do this inside the createTestServer function unfortunately
addTearDown(() => testServer.stop());

final connector = TestConnector(() async {
return PowerSyncCredentials(
endpoint: testServer.uri.toString(),
Expand Down

0 comments on commit 0d557cb

Please sign in to comment.