@@ -24,7 +24,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
24
24
});
25
25
26
26
test ("for an obsolete deprecation" , () async {
27
- // TODO: test this when a deprecation is obsoleted
27
+ var sass = await runSass ([
28
+ "--silence-deprecation=moz-document" ,
29
+ "test.scss" ,
30
+ ]);
31
+ expect (sass.stderr,
32
+ emits (contains ("moz-document deprecation is obsolete" )));
33
+ await sass.shouldExit (0 );
28
34
});
29
35
30
36
test ("for an inactive future deprecation" , () async {
@@ -107,45 +113,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
107
113
108
114
group ("silences" , () {
109
115
group ("a parse-time deprecation" , () {
110
- setUp (
111
- () => d.file ("test.scss" , "@if true {} @elseif false {}" ).create (),
112
- );
113
-
114
- test ("in immediate mode" , () async {
115
- var sass = await runSass ([
116
- "--silence-deprecation=elseif" ,
117
- "test.scss" ,
118
- ]);
119
- expect (sass.stderr, emitsDone);
120
- await sass.shouldExit (0 );
121
- });
122
-
123
- test ("in watch mode" , () async {
124
- var sass = await runSass ([
125
- "--watch" ,
126
- "--poll" ,
127
- "--silence-deprecation=elseif" ,
128
- "test.scss:out.css" ,
129
- ]);
130
- expect (sass.stderr, emitsDone);
131
-
132
- await expectLater (
133
- sass.stdout,
134
- emitsThrough (endsWith ('Compiled test.scss to out.css.' )),
135
- );
136
- await sass.kill ();
137
- });
138
-
139
- test ("in repl mode" , () async {
140
- var sass = await runSass ([
141
- "--interactive" ,
142
- "--silence-deprecation=strict-unary" ,
143
- ]);
144
- expect (sass.stderr, emitsDone);
145
- sass.stdin.writeln ("4 -(5)" );
146
- await expectLater (sass.stdout, emitsInOrder ([">> 4 -(5)" , "-1" ]));
147
- await sass.kill ();
148
- });
116
+ // TODO: Test this again once new deprecations are added post-2.0.0.
149
117
});
150
118
151
119
group ("an evaluation-time deprecation" , () {
@@ -205,7 +173,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
205
173
setUp (() => d.file ("test.scss" , "" ).create ());
206
174
207
175
test ("for an obsolete deprecation" , () async {
208
- // TODO: test this when a deprecation is obsoleted
176
+ var sass = await runSass ([
177
+ "--fatal-deprecation=moz-document" ,
178
+ "test.scss" ,
179
+ ]);
180
+ expect (sass.stderr,
181
+ emits (contains ("moz-document deprecation is obsolete" )));
182
+ await sass.shouldExit (0 );
209
183
});
210
184
211
185
test ("for an inactive future deprecation" , () async {
@@ -215,43 +189,15 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
215
189
}, skip: true );
216
190
217
191
test ("for a silent deprecation" , () async {
218
- var sass = await runSass ([
219
- "--fatal-deprecation=elseif" ,
220
- "--silence-deprecation=elseif" ,
221
- "test.scss" ,
222
- ]);
223
- expect (sass.stderr, emits (contains ("Ignoring setting to silence" )));
224
- await sass.shouldExit (0 );
192
+ // TODO: Test this again once new deprecations are added post-2.0.0.
225
193
});
226
194
227
195
test ("in watch mode" , () async {
228
- var sass = await runSass ([
229
- "--watch" ,
230
- "--poll" ,
231
- "--fatal-deprecation=elseif" ,
232
- "--silence-deprecation=elseif" ,
233
- "test.scss:out.css" ,
234
- ]);
235
- expect (sass.stderr, emits (contains ("Ignoring setting to silence" )));
236
-
237
- await expectLater (
238
- sass.stdout,
239
- emitsThrough (endsWith ('Compiled test.scss to out.css.' )),
240
- );
241
- await sass.kill ();
196
+ // TODO: Test this again once new deprecations are added post-2.0.0.
242
197
});
243
198
244
199
test ("in repl mode" , () async {
245
- var sass = await runSass ([
246
- "--interactive" ,
247
- "--fatal-deprecation=elseif" ,
248
- "--silence-deprecation=elseif" ,
249
- ]);
250
- await expectLater (
251
- sass.stderr,
252
- emits (contains ("Ignoring setting to silence" )),
253
- );
254
- await sass.kill ();
200
+ // TODO: Test this again once new deprecations are added post-2.0.0.
255
201
});
256
202
});
257
203
@@ -299,54 +245,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
299
245
});
300
246
301
247
group ("a parse-time deprecation" , () {
302
- setUp (
303
- () => d.file ("test.scss" , "@if true {} @elseif false {}" ).create (),
304
- );
305
-
306
- test ("in immediate mode" , () async {
307
- var sass = await runSass (["--fatal-deprecation=elseif" , "test.scss" ]);
308
- expect (sass.stderr, emits (startsWith ("Error: " )));
309
- await sass.shouldExit (65 );
310
- });
311
-
312
- test ("in watch mode" , () async {
313
- var sass = await runSass ([
314
- "--watch" ,
315
- "--poll" ,
316
- "--fatal-deprecation=elseif" ,
317
- "test.scss:out.css" ,
318
- ]);
319
- await expectLater (sass.stderr, emits (startsWith ("Error: " )));
320
- await expectLater (
321
- sass.stdout,
322
- emitsInOrder ([
323
- "Sass is watching for changes. Press Ctrl-C to stop." ,
324
- "" ,
325
- ]),
326
- );
327
- await sass.kill ();
328
- });
329
-
330
- test ("in repl mode" , () async {
331
- var sass = await runSass ([
332
- "--interactive" ,
333
- "--fatal-deprecation=strict-unary" ,
334
- ]);
335
- sass.stdin.writeln ("4 -(5)" );
336
- await expectLater (
337
- sass.stdout,
338
- emitsInOrder ([
339
- ">> 4 -(5)" ,
340
- emitsThrough (startsWith ("Error: " )),
341
- emitsThrough (contains ("Remove this setting" )),
342
- ]),
343
- );
344
-
345
- // Verify that there's no output written for the previous line.
346
- sass.stdin.writeln ("1" );
347
- await expectLater (sass.stdout, emitsInOrder ([">> 1" , "1" ]));
348
- await sass.kill ();
349
- });
248
+ // TODO: Test this again once new deprecations are added post-2.0.0.
350
249
});
351
250
352
251
group ("an evaluation-time deprecation" , () {
@@ -451,8 +350,16 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
451
350
});
452
351
});
453
352
454
- group ("an obsolete deprecation" , () {
455
- // TODO: test this when there are obsolete deprecations
353
+ test ("an obsolete deprecation" , () async {
354
+ var sass = await runSass ([
355
+ "--future-deprecation=moz-document" ,
356
+ "test.scss" ,
357
+ ]);
358
+ expect (
359
+ sass.stderr,
360
+ emits (contains ("moz-document is not a future deprecation" )),
361
+ );
362
+ await sass.shouldExit (0 );
456
363
});
457
364
458
365
group ("a parse-time deprecation" , () {
0 commit comments