File tree Expand file tree Collapse file tree
serverpod_cloud_cli/test_integration/commands/auth Expand file tree Collapse file tree Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments