TestCommand constructor

TestCommand()

Implementation

TestCommand() {
  argParser.addOptionMorphemeYaml();
  argParser.addOption(
    'apps',
    abbr: 'a',
    help: 'Test with spesific apps (Optional)',
  );
  argParser.addOption(
    'feature',
    abbr: 'f',
    help: 'Test with spesific feature (optional)',
  );
  argParser.addOption(
    'page',
    abbr: 'p',
    help: 'Test with spesific page (optional)',
  );
  argParser.addFlag(
    'coverage',
    abbr: 'c',
    help: 'Run test with coverage',
    defaultsTo: false,
  );
  argParser.addOption(
    'reporter',
    abbr: 'r',
    help:
        '''Set how to print test results. If unset, value will default to either compact or expanded.

        [compact]                                          A single line, updated continuously (the default).
        [expanded]                                         A separate line for each update. May be preferred when logging to a file or in continuous integration.
        [failures-only]                                    A separate line for failing tests, with no output for passing tests.
        [github]                                           A custom reporter for GitHub Actions (the default reporter when running on GitHub Actions).
        [json]                                             A machine-readable format. See: https://dart.cn/go/test-docs/json_reporter.md
        [silent]                                           A reporter with no output. May be useful when only the exit code is meaningful.''',
    allowed: [
      'compact',
      'expanded',
      'failures-only',
      'github',
      'json',
      'silent',
    ],
  );
  argParser.addOption(
    'file-reporter',
    help: '''Enable an additional reporter writing test results to a file.
                                                           Should be in the form <reporter>:<filepath>, Example: "json:reports/tests.json".''',
  );
}