@@ -23,6 +23,7 @@ const expectedTestUsage = [
23
23
'''-x, --exclude-tags Run only tests that do not have the specified tags.\n '''
24
24
''' --min-coverage Whether to enforce a minimum coverage percentage.\n '''
25
25
''' --test-randomize-ordering-seed The seed to randomize the execution order of test cases within test files.\n '''
26
+ ''' --update-goldens Whether "matchesGoldenFile()" calls within your test methods should update the golden files.\n '''
26
27
'\n '
27
28
'Run "very_good help" to see global options.'
28
29
];
@@ -89,6 +90,7 @@ void main() {
89
90
).thenAnswer ((_) async {});
90
91
when < dynamic > (() => argResults['recursive' ]).thenReturn (false );
91
92
when < dynamic > (() => argResults['coverage' ]).thenReturn (false );
93
+ when < dynamic > (() => argResults['update-goldens' ]).thenReturn (false );
92
94
when < dynamic > (() => argResults['optimization' ]).thenReturn (true );
93
95
when (() => argResults.rest).thenReturn ([]);
94
96
});
@@ -180,6 +182,20 @@ void main() {
180
182
).called (1 );
181
183
});
182
184
185
+ test ('completes normally --update-goldens' , () async {
186
+ when < dynamic > (() => argResults['update-goldens' ]).thenReturn (true );
187
+ final result = await testCommand.run ();
188
+ expect (result, equals (ExitCode .success.code));
189
+ verify (
190
+ () => flutterTest (
191
+ arguments: ['--update-goldens' , ...defaultArguments],
192
+ progress: logger.progress,
193
+ stdout: logger.write,
194
+ stderr: logger.err,
195
+ ),
196
+ ).called (1 );
197
+ });
198
+
183
199
test ('completes normally --test-randomize-ordering-seed random' , () async {
184
200
when < dynamic > (
185
201
() => argResults['test-randomize-ordering-seed' ],
0 commit comments