change method

Configuration change({
  1. bool? help,
  2. String? customHtmlTemplatePath,
  3. bool? version,
  4. bool? pauseAfterLoad,
  5. bool? debug,
  6. bool? color,
  7. String? configurationPath,
  8. String? reporter,
  9. Map<String, String>? fileReporters,
  10. String? coverage,
  11. int? concurrency,
  12. int? shardIndex,
  13. int? totalShards,
  14. Map<String, Set<TestSelection>>? testSelections,
  15. Iterable<String>? exceptPackages,
  16. Iterable<String>? onlyPackages,
  17. Glob? filename,
  18. Iterable<String>? chosenPresets,
  19. Map<String, Configuration>? presets,
  20. Map<String, RuntimeSettings>? overrideRuntimes,
  21. Map<String, CustomRuntime>? defineRuntimes,
  22. bool? noRetry,
  23. int? testRandomizeOrderingSeed,
  24. bool? ignoreTimeouts,
  25. bool? allowDuplicateTestNames,
  26. bool? jsTrace,
  27. bool? runSkipped,
  28. Iterable<String>? dart2jsArgs,
  29. String? precompiledPath,
  30. Iterable<RuntimeSelection>? runtimes,
  31. BooleanSelector? includeTags,
  32. BooleanSelector? excludeTags,
  33. Map<BooleanSelector, SuiteConfiguration>? tags,
  34. Map<PlatformSelector, SuiteConfiguration>? onPlatform,
  35. Timeout? timeout,
  36. bool? verboseTrace,
  37. bool? chainStackTraces,
  38. bool? skip,
  39. String? skipReason,
  40. PlatformSelector? testOn,
  41. Iterable<String>? addTags,
})

Returns a copy of this configuration with the given fields updated.

Note that unlike merge, this has no merging behavior—the old value is always replaced by the new one.

Implementation

Configuration change(
    {bool? help,
    String? customHtmlTemplatePath,
    bool? version,
    bool? pauseAfterLoad,
    bool? debug,
    bool? color,
    String? configurationPath,
    String? reporter,
    Map<String, String>? fileReporters,
    String? coverage,
    int? concurrency,
    int? shardIndex,
    int? totalShards,
    Map<String, Set<TestSelection>>? testSelections,
    Iterable<String>? exceptPackages,
    Iterable<String>? onlyPackages,
    Glob? filename,
    Iterable<String>? chosenPresets,
    Map<String, Configuration>? presets,
    Map<String, RuntimeSettings>? overrideRuntimes,
    Map<String, CustomRuntime>? defineRuntimes,
    bool? noRetry,
    int? testRandomizeOrderingSeed,
    bool? ignoreTimeouts,

    // Suite-level configuration
    bool? allowDuplicateTestNames,
    bool? jsTrace,
    bool? runSkipped,
    Iterable<String>? dart2jsArgs,
    String? precompiledPath,
    Iterable<RuntimeSelection>? runtimes,
    BooleanSelector? includeTags,
    BooleanSelector? excludeTags,
    Map<BooleanSelector, SuiteConfiguration>? tags,
    Map<PlatformSelector, SuiteConfiguration>? onPlatform,

    // Test-level configuration
    Timeout? timeout,
    bool? verboseTrace,
    bool? chainStackTraces,
    bool? skip,
    String? skipReason,
    PlatformSelector? testOn,
    Iterable<String>? addTags}) {
  var config = Configuration._(
      help: help ?? _help,
      customHtmlTemplatePath:
          customHtmlTemplatePath ?? this.customHtmlTemplatePath,
      version: version ?? _version,
      pauseAfterLoad: pauseAfterLoad ?? _pauseAfterLoad,
      debug: debug ?? _debug,
      color: color ?? _color,
      configurationPath: configurationPath ?? _configurationPath,
      reporter: reporter ?? _reporter,
      fileReporters: fileReporters ?? this.fileReporters,
      coverage: coverage ?? this.coverage,
      concurrency: concurrency ?? _concurrency,
      shardIndex: shardIndex ?? this.shardIndex,
      totalShards: totalShards ?? this.totalShards,
      testSelections: testSelections ?? _testSelections,
      foldTraceExcept: exceptPackages ?? _foldTraceExcept,
      foldTraceOnly: onlyPackages ?? _foldTraceOnly,
      filename: filename ?? _filename,
      chosenPresets: chosenPresets ?? this.chosenPresets,
      presets: presets ?? this.presets,
      overrideRuntimes: overrideRuntimes ?? this.overrideRuntimes,
      defineRuntimes: defineRuntimes ?? this.defineRuntimes,
      noRetry: noRetry ?? _noRetry,
      testRandomizeOrderingSeed:
          testRandomizeOrderingSeed ?? this.testRandomizeOrderingSeed,
      stopOnFirstFailure: _stopOnFirstFailure,
      includeTags: includeTags,
      excludeTags: excludeTags,
      globalPatterns: globalPatterns,
      suiteDefaults: suiteDefaults.change(
        allowDuplicateTestNames: allowDuplicateTestNames,
        jsTrace: jsTrace,
        runSkipped: runSkipped,
        dart2jsArgs: dart2jsArgs,
        precompiledPath: precompiledPath,
        runtimes: runtimes,
        tags: tags,
        onPlatform: onPlatform,
        timeout: timeout,
        verboseTrace: verboseTrace,
        chainStackTraces: chainStackTraces,
        skip: skip,
        skipReason: skipReason,
        testOn: testOn,
        addTags: addTags,
        ignoreTimeouts: ignoreTimeouts,
      ));
  return config._resolvePresets();
}