Skip to content

Commit

Permalink
fix build_resolvers tests (#3257)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemac53 committed Mar 9, 2022
1 parent bac6d4a commit 6ccafdf
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions build_resolvers/test/resolver_test.dart
Expand Up @@ -195,13 +195,14 @@ void main() {
}, test, resolvers: AnalyzerResolvers());
}

final otherId = AssetId.parse('a|lib/other.dart');

test('can be resolved', () {
return _runWith((resolver) async {
final main = await resolver.libraryFor(entryPoint);
expect(main, isNotNull);

final other =
await resolver.libraryFor(AssetId.parse('a|lib/other.dart'));
final other = await resolver.libraryFor(otherId);
expect(other.name, 'other');
});
});
Expand All @@ -211,19 +212,19 @@ void main() {
await expectLater(
resolver.libraries.map((l) => l.name), neverEmits('other'));

await resolver.libraryFor(entryPoint);
await resolver.libraryFor(otherId);

await expectLater(
resolver.libraries.map((l) => l.name), emits('other'),
skip: 'https://github.com/dart-lang/build/issues/3256');
resolver.libraries.map((l) => l.name), emitsThrough('other'));
});
});

test('can be found by name', () {
return _runWith((resolver) async {
await resolver.libraryFor(entryPoint);
await resolver.libraryFor(otherId);

expect(resolver.findLibraryByName('other'), completion(isNotNull));
await expectLater(
resolver.findLibraryByName('other'), completion(isNotNull));
});
});
});
Expand Down

0 comments on commit 6ccafdf

Please sign in to comment.