@@ -42,9 +42,7 @@ void main() {
4242
4343 test ('Errors with `build_runner` should not surface `build_daemon` issues' ,
4444 () async {
45- await d.file ('pubspec.yaml' , '''
46- name: sample
47- ''' ).create ();
45+ await d.file ('pubspec.yaml' , _pubspecYaml).create ();
4846
4947 await d
5048 .file (
@@ -56,8 +54,7 @@ name: sample
5654 .create ();
5755
5856 await d.dir ('.dart_tool' , [d.file ('package_config.json' , '' )]).create ();
59- await d.file ('.dart_tool/package_config.json' , '''
60- ''' ).create ();
57+ await d.file ('.dart_tool/package_config.json' , '' ).create ();
6158
6259 var process =
6360 await testRunner.runWebDev (['serve' ], workingDirectory: d.sandbox);
@@ -79,18 +76,15 @@ name: sample
7976 group ('`$command ` command' , () {
8077 group ('missing dependency on' , () {
8178 test ('`build_runner` should fail' , () async {
82- await d.file ('pubspec.yaml' , '''
83- name: sample
84- ''' ).create ();
79+ await d.file ('pubspec.yaml' , _pubspecYaml).create ();
8580
8681 await d
8782 .file ('pubspec.lock' , _pubspecLock (runnerVersion: null ))
8883 .create ();
8984
9085 await d
9186 .dir ('.dart_tool' , [d.file ('package_config.json' , '' )]).create ();
92- await d.file ('.dart_tool/package_config.json' , '''
93- ''' ).create ();
87+ await d.file ('.dart_tool/package_config.json' , '' ).create ();
9488
9589 var process = await testRunner
9690 .runWebDev ([command], workingDirectory: d.sandbox);
@@ -103,18 +97,15 @@ name: sample
10397 });
10498
10599 test ('`build_web_compilers` should fail' , () async {
106- await d.file ('pubspec.yaml' , '''
107- name: sample
108- ''' ).create ();
100+ await d.file ('pubspec.yaml' , _pubspecYaml).create ();
109101
110102 await d
111103 .file ('pubspec.lock' , _pubspecLock (webCompilersVersion: null ))
112104 .create ();
113105
114106 await d
115107 .dir ('.dart_tool' , [d.file ('package_config.json' , '' )]).create ();
116- await d.file ('.dart_tool/package_config.json' , '''
117- ''' ).create ();
108+ await d.file ('.dart_tool/package_config.json' , '' ).create ();
118109
119110 var process = await testRunner
120111 .runWebDev (['serve' ], workingDirectory: d.sandbox);
@@ -129,18 +120,15 @@ name: sample
129120 test (
130121 '`build_web_compilers` should be ignored with '
131122 '--no-build-web-compilers' , () async {
132- await d.file ('pubspec.yaml' , '''
133- name: sample
134- ''' ).create ();
123+ await d.file ('pubspec.yaml' , _pubspecYaml).create ();
135124
136125 await d
137126 .file ('pubspec.lock' , _pubspecLock (webCompilersVersion: null ))
138127 .create ();
139128
140129 await d
141130 .dir ('.dart_tool' , [d.file ('package_config.json' , '' )]).create ();
142- await d.file ('.dart_tool/package_config.json' , '''
143- ''' ).create ();
131+ await d.file ('.dart_tool/package_config.json' , '' ).create ();
144132
145133 // Required for webdev to not complain about nothing to serve.
146134 await d.dir ('web' ).create ();
@@ -177,9 +165,7 @@ name: sample
177165 supportedRange = '^$_supportedBuildDaemonVersion ' ;
178166 }
179167
180- await d.file ('pubspec.yaml' , '''
181- name: sample
182- ''' ).create ();
168+ await d.file ('pubspec.yaml' , _pubspecYaml).create ();
183169
184170 await d
185171 .file (
@@ -192,8 +178,7 @@ name: sample
192178
193179 await d.dir (
194180 '.dart_tool' , [d.file ('package_config.json' , '' )]).create ();
195- await d.file ('.dart_tool/package_config.json' , '''
196- ''' ).create ();
181+ await d.file ('.dart_tool/package_config.json' , '' ).create ();
197182
198183 var process = await testRunner
199184 .runWebDev (['serve' ], workingDirectory: d.sandbox);
@@ -230,20 +215,22 @@ name: sample
230215 await process.shouldExit (78 );
231216 });
232217
233- test ('pubspec.yaml, no pubspec.lock' , () async {
234- await d. file ( 'pubspec.yaml' , '''
235- name: sample
236- ''' ).create ();
218+ test (
219+ 'pubspec.yaml, no pubspec.lock' ,
220+ () async {
221+ await d. file ( 'pubspec.yaml' , _pubspecYaml ).create ();
237222
238- var process =
239- await testRunner .runWebDev (['serve' ], workingDirectory: d.sandbox);
223+ var process = await testRunner
224+ .runWebDev (['serve' ], workingDirectory: d.sandbox);
240225
241- await checkProcessStdout (process, [
242- 'webdev could not run for this project.' ,
243- 'No pubspec.lock file found, please run "$pubCommand get" first.'
244- ]);
245- await process.shouldExit (78 );
246- });
226+ await checkProcessStdout (process, [
227+ 'webdev could not run for this project.' ,
228+ 'No pubspec.lock file found, please run "$pubCommand get" first.'
229+ ]);
230+ await process.shouldExit (78 );
231+ },
232+ skip: 'https://github.com/dart-lang/webdev/issues/2050' ,
233+ );
247234
248235 test ('should fail if there has been a dependency change' , () async {
249236 await d.file ('pubspec.lock' , _pubspecLock ()).create ();
@@ -271,7 +258,7 @@ dependencies:
271258 'was generated, please run "$pubCommand get" again.'
272259 ]);
273260 await process.shouldExit (78 );
274- });
261+ }, skip : 'https://github.com/dart-lang/webdev/issues/2050' );
275262 });
276263 }
277264}
@@ -280,6 +267,10 @@ const _supportedBuildRunnerVersion = '2.4.0';
280267const _supportedWebCompilersVersion = '4.0.0' ;
281268const _supportedBuildDaemonVersion = '4.0.0' ;
282269
270+ String _pubspecYaml = '''
271+ name: sample
272+ ''' ;
273+
283274String _pubspecLock (
284275 {String ? runnerVersion = _supportedBuildRunnerVersion,
285276 String ? webCompilersVersion = _supportedWebCompilersVersion,
0 commit comments