@@ -21,7 +21,8 @@ void main() {
2121 });
2222
2323 test ('no customization' , () async {
24- const expected = '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
24+ const expected =
25+ '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
2526 '// ignore_for_file: type=lint, type=warning\n '
2627 '\n '
2728 "import 'package:flutter/material.dart';\n "
@@ -43,8 +44,10 @@ void main() {
4344
4445 test ('existing step should not regenerate' , () async {
4546 const scenario = 'existing_step' ;
46- final dummyStepPath =
47- p.join (getStepFolderName (scenario), 'the_app_is_running.dart' );
47+ final dummyStepPath = p.join (
48+ getStepFolderName (scenario),
49+ 'the_app_is_running.dart' ,
50+ );
4851 const expectedFileContent = '// existing step' ;
4952 fs.file (dummyStepPath)
5053 ..createSync (recursive: true )
@@ -66,16 +69,20 @@ relativeToTestFolder: false
6669 ..writeAsStringSync (bddOptions);
6770
6871 const scenario = 'existing_step_outside_test_folder' ;
69- final dummyStepPath =
70- p.join (fs.currentDirectory.path, 'my_steps' , 'the_app_is_running.dart' );
72+ final dummyStepPath = p.join (
73+ fs.currentDirectory.path,
74+ 'my_steps' ,
75+ 'the_app_is_running.dart' ,
76+ );
7177 fs.file (dummyStepPath)
7278 ..createSync (recursive: true )
7379 ..writeAsStringSync ('dummy' );
7480
7581 // note: the import is so weird because p.relative() can not
7682 // find intersection between two paths (however, somehow it works)
7783 // not a problem in the real world
78- const expected = '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
84+ const expected =
85+ '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
7986 '// ignore_for_file: type=lint, type=warning\n '
8087 '\n '
8188 "import 'package:flutter/material.dart';\n "
@@ -107,7 +114,8 @@ hookFolderName: hooksFolder
107114 ..createSync ()
108115 ..writeAsStringSync (bddOptions);
109116
110- const expected = '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
117+ const expected =
118+ '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
111119 '// ignore_for_file: type=lint, type=warning\n '
112120 '\n '
113121 "import 'package:flutter/material.dart';\n "
@@ -139,7 +147,7 @@ hookFolderName: hooksFolder
139147 ' try {\n '
140148 " await beforeEach('''Testing scenario''');\n "
141149 ' await theAppIsRunning(tester);\n '
142- ' } on TestFailure {\n '
150+ ' } catch (_) {\n '
143151 ' success = false;\n '
144152 ' rethrow;\n '
145153 ' } finally {\n '
@@ -164,10 +172,7 @@ hookFolderName: hooksFolder
164172 ..writeAsStringSync (bddOptions);
165173
166174 const scenario = 'options' ;
167- expect (
168- () => generate (scenario),
169- throwsException,
170- );
175+ expect (() => generate (scenario), throwsException);
171176 });
172177
173178 test ('merge options' , () async {
@@ -187,7 +192,8 @@ testMethodName: customName
187192stepFolderName: ./scenarios
188193''' );
189194
190- const expected = '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
195+ const expected =
196+ '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
191197 '// ignore_for_file: type=lint, type=warning\n '
192198 '\n '
193199 "import 'package:flutter/material.dart';\n "
@@ -241,7 +247,8 @@ include: $externalYaml3
241247stepFolderName: ./scenarios
242248''' );
243249
244- const expected = '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
250+ const expected =
251+ '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
245252 '// ignore_for_file: type=lint, type=warning\n '
246253 '\n '
247254 "import 'package:flutter/material.dart';\n "
@@ -260,9 +267,7 @@ stepFolderName: ./scenarios
260267 const scenario = 'options' ;
261268 final content = await generate (
262269 scenario,
263- const BuilderOptions (< String , dynamic > {
264- 'include' : externalYaml3,
265- }),
270+ const BuilderOptions (< String , dynamic > {'include' : externalYaml3}),
266271 );
267272 expect (content, expected);
268273 });
@@ -276,7 +281,8 @@ dev_dependencies:
276281 sdk: flutter
277282''' );
278283
279- const expected = '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
284+ const expected =
285+ '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
280286 '// ignore_for_file: type=lint, type=warning\n '
281287 '\n '
282288 "import 'package:flutter/material.dart';\n "
@@ -307,7 +313,8 @@ dev_dependencies:
307313dev_dependencies:
308314''' );
309315
310- const expected = '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
316+ const expected =
317+ '// GENERATED CODE - DO NOT MODIFY BY HAND\n '
311318 '// ignore_for_file: type=lint, type=warning\n '
312319 '\n '
313320 "import 'package:flutter/material.dart';\n "
@@ -356,9 +363,9 @@ Future<String> generate(
356363}
357364
358365String getStepFolderName (String scenario) => p.joinAll ([
359- fs.currentDirectory.path,
360- 'test' ,
361- 'builder_scenarios' ,
362- scenario,
363- 'step' ,
364- ]);
366+ fs.currentDirectory.path,
367+ 'test' ,
368+ 'builder_scenarios' ,
369+ scenario,
370+ 'step' ,
371+ ]);
0 commit comments