File tree 2 files changed +20
-3
lines changed
2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,13 @@ class Flutter {
143
143
'Running "flutter test" in ${p .dirname (workingDirectory )}...\n ' ,
144
144
);
145
145
146
+ if (! Directory (p.join (target.dir.absolute.path, 'test' )).existsSync ()) {
147
+ stdout? .call (
148
+ 'No test folder found in ${target .dir .absolute .path }' ,
149
+ );
150
+ return ExitCode .success.code;
151
+ }
152
+
146
153
if (randomSeed != null ) {
147
154
stdout? .call (
148
155
'''Shuffling test order with --test-randomize-ordering-seed=$randomSeed \n ''' ,
Original file line number Diff line number Diff line change @@ -355,14 +355,24 @@ void main() {
355
355
).ensureDeleted ();
356
356
});
357
357
358
- test ('exits with code 69 when there is no test directory' , () {
358
+ test ('exits with code 0 when there is no test directory' , () {
359
359
final directory = Directory .systemTemp.createTempSync ();
360
360
File (p.join (directory.path, 'pubspec.yaml' )).writeAsStringSync (pubspec);
361
361
362
362
expectLater (
363
- Flutter .test (cwd: directory.path),
364
- completion (equals ([69 ])),
363
+ Flutter .test (cwd: directory.path, stdout : logger.write ),
364
+ completion (equals ([ExitCode .success.code ])),
365
365
);
366
+
367
+ verify (
368
+ () => logger.write (
369
+ any (
370
+ that: contains (
371
+ 'No test folder found in ${directory .path }' ,
372
+ ),
373
+ ),
374
+ ),
375
+ ).called (1 );
366
376
});
367
377
368
378
test ('throws when there is no pubspec.yaml (recursive)' , () {
You can’t perform that action at this time.
0 commit comments