Skip to content

Commit 64342de

Browse files
author
serverpod_cloud
committed
chore: 4aa9399c7a90f0ed5477df7b4eaa67e7e68abcab
1 parent d84aa97 commit 64342de

1 file changed

Lines changed: 25 additions & 14 deletions

File tree

serverpod_cloud_cli/test_integration/commands/auth/login_command_test.dart

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -208,34 +208,45 @@ void main() {
208208
});
209209

210210
group('when logging in through cli', () {
211-
late Future cliOnDone;
212-
setUp(() async {
213-
cliOnDone = cli.run([
211+
tearDown(() async {
212+
await ResourceManager.removeServerpodCloudData(
213+
localStoragePath: testCacheFolderPath,
214+
);
215+
});
216+
217+
test('then cli command completes throws an exit exception.', () async {
218+
final cliOnDone = cli.run([
214219
'auth',
215220
'login',
216221
'--no-browser',
217222
'--scloud-dir',
218223
testCacheFolderPath
219224
]);
220-
});
221225

222-
tearDown(() async {
223-
await ResourceManager.removeServerpodCloudData(
224-
localStoragePath: testCacheFolderPath,
226+
await expectLater(
227+
Future.wait([
228+
cliOnDone,
229+
tokenSent.future,
230+
]),
231+
throwsA(isA<ErrorExitException>()),
225232
);
226233
});
227234

228-
test('then cli command completes throws an exit exception.', () async {
229-
await tokenSent.future;
235+
test('then no cloud data is stored.', () async {
236+
final cliOnDone = cli.run([
237+
'auth',
238+
'login',
239+
'--no-browser',
240+
'--scloud-dir',
241+
testCacheFolderPath
242+
]);
230243

231-
await expectLater(cliOnDone, throwsA(isA<ErrorExitException>()));
232-
});
244+
// Silence the error message.
245+
final cliFuture = cliOnDone.catchError((final _) {});
233246

234-
test('then no cloud data is stored.', () async {
235247
await tokenSent.future;
236248

237-
// Silence the error message.
238-
await cliOnDone.catchError((final _) {});
249+
await cliFuture;
239250

240251
final storedCloudData =
241252
await ResourceManager.tryFetchServerpodCloudData(

0 commit comments

Comments
 (0)