build_test
library
Properties
assetNotFoundException
→ TypeMatcher<AssetNotFoundException >
Matches instance of AssetNotFoundException
.
final
invalidInputException
→ TypeMatcher<InvalidInputException >
Matches instance of InvalidInputException
.
final
invalidOutputException
→ TypeMatcher<InvalidOutputException >
Matches instance of InvalidOutputException
.
final
packageNotFoundException
→ TypeMatcher<PackageNotFoundException >
Matches instance of PackageNotFoundException
.
final
Functions
addAssets (Map <AssetId , dynamic > assets , InMemoryAssetWriter writer )
→ void
anyLogOf (dynamic messageOrMatcher )
→ Matcher
Matches LogRecord
of any level whose message is messageOrMatcher
.
appendExtension (String postFix , {String from = '' , int numCopies = 1 })
→ Map <String , List <String > >
A Builder.buildExtensions
which operats on assets ending in from
and
creates outputs with postFix
appended as the extension.
checkOutputs (Map <String , Object > ? outputs , Iterable <AssetId > actualAssets , RecordingAssetWriter writer , {AssetId mapAssetIds (AssetId id ) = _passThrough })
→ void
Validates that actualAssets
matches the expected outputs
.
copyFrom (AssetId assetId )
→ BuildBehavior
A build behavior which reads assetId
and copies it's content into every
output.
decodedMatches (dynamic expected , {Encoding ? encoding })
→ TypeMatcher<List <int > >
Decodes the value using encoding
and matches it against expected
.
infoLogOf (dynamic messageOrMatcher )
→ Matcher
Matches LogRecord
of Level.INFO
where message is messageOrMatcher
.
makeAssetId ([String ? assetIdString ])
→ AssetId
recordLogs (dynamic run (), {String name = '' })
→ Stream <LogRecord >
Executes run
with a new Logger
, returning the resulting log records.
replaceExtension (String from , String to )
→ Map <String , List <String > >
resolveAsset <T > (AssetId inputId , FutureOr <T > action (Resolver resolver ), {PackageConfig? packageConfig , Future <void > ? tearDown , Resolvers? resolvers })
→ Future <T >
A convenience for using resolveSources with a single inputId
from disk.
resolveSource <T > (String inputSource , FutureOr <T > action (Resolver resolver ), {AssetId? inputId , PackageConfig? packageConfig , Future <void > ? tearDown , Resolvers? resolvers })
→ Future <T >
A convenience method for using resolveSources with a single source file.
resolveSources <T > (Map <String , String > inputs , FutureOr <T > action (Resolver resolver ), {PackageConfig? packageConfig , String ? resolverFor , String ? rootPackage , Future <void > ? tearDown , Resolvers? resolvers })
→ Future <T >
Resolves and runs action
using a created resolver for inputs
.
scopeLogAsync <T > (Future <T > fn (), Logger log )
→ Future <T >
Runs fn
in an error handling Zone .
severeLogOf (dynamic messageOrMatcher )
→ Matcher
Matches LogRecord
of Level.SEVERE
where message is messageOrMatcher
.
testBuilder (Builder builder , Map <String , Object > sourceAssets , {Set <String > ? generateFor , bool isInput (String assetId )?, String ? rootPackage , MultiPackageAssetReader? reader , RecordingAssetWriter ? writer , Map <String , Object > ? outputs , void onLog (LogRecord log )?, void reportUnusedAssetsForInput (AssetId , Iterable <AssetId > )?, PackageConfig? packageConfig })
→ Future
Runs builder
in a test environment.
warningLogOf (dynamic messageOrMatcher )
→ Matcher
Matches LogRecord
of Level.WARNING
where message is messageOrMatcher
.
writeCanRead (AssetId assetId )
→ BuildBehavior
A build behavior which writes either 'true' or 'false' depending on whether
assetId
can be read.