matcherNormalizedPrioritizedSourceChangeSnapshot function

  1. @visibleForTesting
Matcher matcherNormalizedPrioritizedSourceChangeSnapshot(
  1. String filePath, {
  2. JsonEncoder? encoder,
  3. Map<String, String>? sources,
  4. String? relativePath,
})

Expects that a List<PrioritizedSourceChange> matches with a serialized snapshots.

This effectively encode the list of changes, remove file paths from the result, and compare this output with the content of a file.

  • sources is an optional map of file paths to their content. If specified, the changes will be applied to their corresponding source, and the result will be saved in the diff. Glob syntax is supported in the file paths.
  • relativePath can be specified to change file paths in goldens to be relative to a specific directory.

Implementation

@visibleForTesting
Matcher matcherNormalizedPrioritizedSourceChangeSnapshot(
  String filePath, {
  JsonEncoder? encoder,
  Map<String, String>? sources,
  String? relativePath,
}) {
  return _MatcherNormalizedPrioritizedSourceChangeSnapshot(
    filePath,
    encoder: encoder,
    sources: sources,
    relativePath: relativePath,
  );
}