assertPubspecDiagnostics method
Asserts that expectedDiagnostics are reported when resolving content.
Note: Be sure to await any use of this API, to avoid stale analysis
results (See DisposedAnalysisContextResult).
Implementation
Future<void> assertPubspecDiagnostics(
String content,
List<ExpectedDiagnostic> expectedDiagnostics,
) async {
newFile(testPackagePubspecPath, content);
var errors = await _analyzePubspecFile(content);
assertDiagnosticsIn(errors, expectedDiagnostics);
}