mirror of https://github.com/AMT-Cheif/drift.git
Expand allowlist for assets in test
This commit is contained in:
parent
b94516acc7
commit
ccae3b4ee6
|
@ -578,13 +578,15 @@ class MyDatabase {
|
||||||
};
|
};
|
||||||
final outputs = await emulateDriftBuild(inputs: inputs);
|
final outputs = await emulateDriftBuild(inputs: inputs);
|
||||||
final readAssets = outputs.readAssetsByBuilder;
|
final readAssets = outputs.readAssetsByBuilder;
|
||||||
|
// Allow reading SDK or other package assets to set up the analyzer.
|
||||||
|
final isFromExternalPackage =
|
||||||
|
isA<AssetId>().having((e) => e.package, 'package', isNot('a'));
|
||||||
|
|
||||||
Matcher onlyReadsJsonsAnd(dynamic other) {
|
Matcher onlyReadsJsonsAnd(dynamic other) {
|
||||||
return everyElement(
|
return everyElement(
|
||||||
anyOf(
|
anyOf(
|
||||||
isA<AssetId>().having((e) => e.extension, 'extension', '.json'),
|
isA<AssetId>().having((e) => e.extension, 'extension', '.json'),
|
||||||
// Allow reading SDK or other package assets to set up the analyzer.
|
isFromExternalPackage,
|
||||||
isA<AssetId>().having((e) => e.package, 'package', isNot('a')),
|
|
||||||
other,
|
other,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -608,7 +610,8 @@ class MyDatabase {
|
||||||
// However, the discover builder should not read other drift files.
|
// However, the discover builder should not read other drift files.
|
||||||
for (final input in inputs.keys) {
|
for (final input in inputs.keys) {
|
||||||
if (input.endsWith('.drift')) {
|
if (input.endsWith('.drift')) {
|
||||||
expectReadsForBuilder(input, DriftDiscover, [makeAssetId(input)]);
|
expectReadsForBuilder(input, DriftDiscover,
|
||||||
|
everyElement(anyOf(makeAssetId(input), isFromExternalPackage)));
|
||||||
} else {
|
} else {
|
||||||
expectReadsForBuilder(
|
expectReadsForBuilder(
|
||||||
input,
|
input,
|
||||||
|
|
Loading…
Reference in New Issue