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. String? coverageLcov,
  12. bool? branchCoverage,
  13. int? concurrency,
  14. int? shardIndex,
  15. int? totalShards,
  16. Map<String, Set<TestSelection>>? testSelections,
  17. Iterable<String>? exceptPackages,
  18. Iterable<String>? onlyPackages,
  19. Glob? filename,
  20. Iterable<String>? chosenPresets,
  21. Map<String, Configuration>? presets,
  22. Map<String, RuntimeSettings>? overrideRuntimes,
  23. Map<String, CustomRuntime>? defineRuntimes,
  24. bool? noRetry,
  25. int? testRandomizeOrderingSeed,
  26. bool? ignoreTimeouts,
  27. bool? allowDuplicateTestNames,
  28. bool? jsTrace,
  29. bool? runSkipped,
  30. Iterable<String>? dart2jsArgs,
  31. String? precompiledPath,
  32. Iterable<RuntimeSelection>? runtimes,
  33. BooleanSelector? includeTags,
  34. BooleanSelector? excludeTags,
  35. Map<BooleanSelector, SuiteConfiguration>? tags,
  36. Map<PlatformSelector, SuiteConfiguration>? onPlatform,
  37. Timeout? timeout,
  38. bool? verboseTrace,
  39. bool? chainStackTraces,
  40. bool? skip,
  41. String? skipReason,
  42. PlatformSelector? testOn,
  43. 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,
  String? coverageLcov,
  bool? branchCoverage,
  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,
    coverageLcov: coverageLcov ?? this.coverageLcov,
    branchCoverage: branchCoverage ?? _branchCoverage,
    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();
}