build_test 0.6.4+1 build_test: ^0.6.4+1 copied to clipboard
Utilities for writing unit tests of Builders.
0.6.4+1 #
- Allow
package:build_barback
v0.4.x
0.6.4 #
- Allow
package:build
v0.10.x AssetReader
implementations always returnFuture
fromcanRead
0.6.3 #
- Added
resolveAsset
, which is similar toresolveSource
but specifies a real asset that lives on the file system. For example, to resolve the main library ofpackage:collection
:
var pkgCollection = new AssetId('collection', 'lib/collection.dart');
var resolver = await resolveAsset(pkgCollection);
// ...
- Supports
package:build_barback >=0.2.0 <0.4.0
.
0.6.2 #
- Internal version bump.
0.6.1 #
- Declare an output extension in
_ResolveSourceBuilder
so it is not skipped
0.6.0 #
- Support build 0.9.0
- Rename
hasInput
tocanRead
inAssetReader
implementations - Replace
declareOutputs
withbuildExtensions
inBuilder
implementations
- Rename
- Breaking
CopyBuilder
no longer has anoutputPackage
field since outputs can only ever be in the same package as inputs.
0.5.2 #
- Add
MultiAssetReader
to the public API.
0.5.1 #
- Add
PackageAssetReader
, a standalone asset reader that uses aPackageResolver
to map anAssetId
to a location on disk. - Add
resolveSource
, a top-level function that can resolve arbitrary Dart source code. This can be useful in testing your own code that uses aResolver
to do type checks.
0.5.0 #
- Add
findAssets
implementations to StubAssetReader an InMemoryAssetReader - BREAKING: InMemoryAssetReader constructor uses named optional parameters
0.4.1 #
- Make
scopeLog
visible so tests can be run with an availablelog
without going through runBuilder.
0.4.0+1 #
- Bug Fix: Correctly identify missing outputs in testBuilder
0.4.0 #
Updates to work with build
version 0.7.0.
New Features #
- The
testBuilder
method now acceptsList<int>
values for bothsourceAssets
andoutputs
. - The
checkOutputs
method is now public.
Breaking Changes #
- The
testBuilder
method now requires aRecordingAssetWriter
instead of just anAssetWriter
for thewriter
parameter. - If a
Matcher
is provided as a value inoutputs
, then it will match against the same value that was written. For example if your builder useswriteAsString
then it will match against that string. If you usewriteAsBytes
then it will match against those bytes. It will not automatically convert to/from bytes and strings. - Deleted the
makeAsset
andmakeAssets
methods. There is no moreAsset
class so these don't really have any value any more. - The signature of
addAssets
has changed tovoid addAssets(Map<AssetId, dynamic> assets, InMemoryAssetWriter writer)
. Values of the map may be eitherString
orList<int>
. InMemoryAssetReader#assets
andInMemoryAssetWriter#assets
have changed to a type ofMap<AssetId, DatedValue>
from a type ofMap<AssetId, DatedString>
.DatedValue
has both astringValue
andbytesValue
getter.InMemoryAssetReader
andInMemoryAssetWriter
have been updated to implement the newAssetReader
andAssetWriter
interfaces (see thebuild
package CHANGELOG for more details).InMemoryAssetReader#cacheAsset
has been changed to two separate methods,void cacheStringAsset(AssetId id, String contents)
andvoid cacheBytesAsset(AssetId id, List<int> bytes)
.- The
equalsAsset
matcher has been removed, since there is no moreAsset
class.
0.3.1 #
- Additional capabilities in testBuilder:
- Filter sourceAssets to inputs with
isInput
- Get log records
- Ignore output expectations when
outputs
is null - Use a custom
writer
- Filter sourceAssets to inputs with
0.3.0 #
- BREAKING removed testPhases utility. Tests should be using testBuilder
- Drop dependency on build_runner package
0.2.1 #
- Support the package split into build/build_runner/build_barback
- Expose additional test utilities that used to be internal to build
0.2.0 #
- Upgrade build package to 0.4.0
- Delete now unnecessary
GenericBuilderTransformer
and useBuilderTransformer
in the tests.
0.1.2 #
- Add
logLevel
andonLog
named args totestPhases
. These can be used to test your log messages, seetest/utils_test.dart
for an example.
0.1.1 #
- Allow String or Matcher for expected output values in
testPhases
.
0.1.0 #
- Initial version, exposes many basic utilities for testing
Builder
s using in memory data structures. Most notably, thetestPhases
method.