@@ -7,11 +7,12 @@ import 'dart:math';
77
88import 'package:args/args.dart' ;
99import 'package:boolean_selector/boolean_selector.dart' ;
10-
1110import 'package:test_api/src/backend/runtime.dart' ; // ignore: implementation_imports
1211import 'package:test_api/src/frontend/timeout.dart' ; // ignore: implementation_imports
13- import '../runtime_selection.dart' ;
12+
13+ import '../../util/io.dart' ;
1414import '../configuration.dart' ;
15+ import '../runtime_selection.dart' ;
1516import 'reporters.dart' ;
1617import 'values.dart' ;
1718
@@ -225,6 +226,20 @@ class _Parser {
225226 return seed;
226227 });
227228
229+ var color = _ifParsed <bool >('color' ) ?? canUseSpecialChars;
230+
231+ var platform = _ifParsed <List <String >>('platform' )
232+ ? .map ((runtime) => RuntimeSelection (runtime))
233+ ? .toList ();
234+ if (platform
235+ ? .any ((runtime) => runtime.name == Runtime .phantomJS.identifier) ??
236+ false ) {
237+ var yellow = color ? '\u 001b[33m' : '' ;
238+ var noColor = color ? '\u 001b[0m' : '' ;
239+ print ('${yellow }Warning:$noColor '
240+ 'PhatomJS is deprecated and will be removed in version ^2.0.0' );
241+ }
242+
228243 return Configuration (
229244 help: _ifParsed ('help' ),
230245 version: _ifParsed ('version' ),
@@ -233,7 +248,7 @@ class _Parser {
233248 jsTrace: _ifParsed ('js-trace' ),
234249 pauseAfterLoad: _ifParsed ('pause-after-load' ),
235250 debug: _ifParsed ('debug' ),
236- color: _ifParsed ( ' color' ) ,
251+ color: color,
237252 configurationPath: _ifParsed ('configuration' ),
238253 dart2jsPath: _ifParsed ('dart2js-path' ),
239254 dart2jsArgs: _ifParsed ('dart2js-args' ),
@@ -247,9 +262,7 @@ class _Parser {
247262 totalShards: totalShards,
248263 timeout: _parseOption ('timeout' , (value) => Timeout .parse (value)),
249264 patterns: patterns,
250- runtimes: _ifParsed <List <String >>('platform' )
251- ? .map ((runtime) => RuntimeSelection (runtime))
252- ? .toList (),
265+ runtimes: platform,
253266 runSkipped: _ifParsed ('run-skipped' ),
254267 chosenPresets: _ifParsed ('preset' ),
255268 paths: _options.rest.isEmpty ? null : _options.rest,
0 commit comments