@@ -42,9 +42,7 @@ void main() {
42
42
43
43
test ('Errors with `build_runner` should not surface `build_daemon` issues' ,
44
44
() async {
45
- await d.file ('pubspec.yaml' , '''
46
- name: sample
47
- ''' ).create ();
45
+ await d.file ('pubspec.yaml' , _pubspecYaml).create ();
48
46
49
47
await d
50
48
.file (
@@ -56,8 +54,7 @@ name: sample
56
54
.create ();
57
55
58
56
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 ();
61
58
62
59
var process =
63
60
await testRunner.runWebDev (['serve' ], workingDirectory: d.sandbox);
@@ -79,18 +76,15 @@ name: sample
79
76
group ('`$command ` command' , () {
80
77
group ('missing dependency on' , () {
81
78
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 ();
85
80
86
81
await d
87
82
.file ('pubspec.lock' , _pubspecLock (runnerVersion: null ))
88
83
.create ();
89
84
90
85
await d
91
86
.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 ();
94
88
95
89
var process = await testRunner
96
90
.runWebDev ([command], workingDirectory: d.sandbox);
@@ -103,18 +97,15 @@ name: sample
103
97
});
104
98
105
99
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 ();
109
101
110
102
await d
111
103
.file ('pubspec.lock' , _pubspecLock (webCompilersVersion: null ))
112
104
.create ();
113
105
114
106
await d
115
107
.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 ();
118
109
119
110
var process = await testRunner
120
111
.runWebDev (['serve' ], workingDirectory: d.sandbox);
@@ -129,18 +120,15 @@ name: sample
129
120
test (
130
121
'`build_web_compilers` should be ignored with '
131
122
'--no-build-web-compilers' , () async {
132
- await d.file ('pubspec.yaml' , '''
133
- name: sample
134
- ''' ).create ();
123
+ await d.file ('pubspec.yaml' , _pubspecYaml).create ();
135
124
136
125
await d
137
126
.file ('pubspec.lock' , _pubspecLock (webCompilersVersion: null ))
138
127
.create ();
139
128
140
129
await d
141
130
.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 ();
144
132
145
133
// Required for webdev to not complain about nothing to serve.
146
134
await d.dir ('web' ).create ();
@@ -177,9 +165,7 @@ name: sample
177
165
supportedRange = '^$_supportedBuildDaemonVersion ' ;
178
166
}
179
167
180
- await d.file ('pubspec.yaml' , '''
181
- name: sample
182
- ''' ).create ();
168
+ await d.file ('pubspec.yaml' , _pubspecYaml).create ();
183
169
184
170
await d
185
171
.file (
@@ -192,8 +178,7 @@ name: sample
192
178
193
179
await d.dir (
194
180
'.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 ();
197
182
198
183
var process = await testRunner
199
184
.runWebDev (['serve' ], workingDirectory: d.sandbox);
@@ -230,20 +215,22 @@ name: sample
230
215
await process.shouldExit (78 );
231
216
});
232
217
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 ();
237
222
238
- var process =
239
- await testRunner .runWebDev (['serve' ], workingDirectory: d.sandbox);
223
+ var process = await testRunner
224
+ .runWebDev (['serve' ], workingDirectory: d.sandbox);
240
225
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
+ );
247
234
248
235
test ('should fail if there has been a dependency change' , () async {
249
236
await d.file ('pubspec.lock' , _pubspecLock ()).create ();
@@ -271,7 +258,7 @@ dependencies:
271
258
'was generated, please run "$pubCommand get" again.'
272
259
]);
273
260
await process.shouldExit (78 );
274
- });
261
+ }, skip : 'https://github.com/dart-lang/webdev/issues/2050' );
275
262
});
276
263
}
277
264
}
@@ -280,6 +267,10 @@ const _supportedBuildRunnerVersion = '2.4.0';
280
267
const _supportedWebCompilersVersion = '4.0.0' ;
281
268
const _supportedBuildDaemonVersion = '4.0.0' ;
282
269
270
+ String _pubspecYaml = '''
271
+ name: sample
272
+ ''' ;
273
+
283
274
String _pubspecLock (
284
275
{String ? runnerVersion = _supportedBuildRunnerVersion,
285
276
String ? webCompilersVersion = _supportedWebCompilersVersion,
0 commit comments