buildStepForTestContent function
Creates an in-memory InMemoryBuildStep from a raw string content.
This is a convenience wrapper around buildStepForTestAsset that constructs a
StringAsset from content. The returned build step records outputs in
memory instead of writing to disk which makes it suitable for tests.
Implementation
@visibleForTesting
/// Creates an in-memory [InMemoryBuildStep] from a raw string [content].
///
/// This is a convenience wrapper around [buildStepForTestAsset] that constructs a
/// [StringAsset] from [content]. The returned build step records outputs in
/// memory instead of writing to disk which makes it suitable for tests.
InMemoryBuildStep buildStepForTestContent(
String content, {
Set<String> allowedExtensions = const {'g.dart'},
Set<String> includePackages = const {},
}) {
return buildStepForTestAsset(
StringAsset(content),
allowedExtensions: allowedExtensions,
includePackages: includePackages,
);
}