Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions app/test/task/end2end_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import '../shared/utils.dart';
const String goldenDir = 'test/task/testdata/goldens';

// TODO: generalize golden testing, use env var for regenerating all goldens.
final _regenerateGoldens = true;
final _regenerateGoldens = false;

// We use a small test profile without flutter packages, because we have to
// run pana+dartdoc for all these package versions, naturally this is slow.
Expand Down Expand Up @@ -55,9 +55,7 @@ void main() {
expect(doc.querySelector('.self-crumb')!.text, contains('oxygen'));
// Check that we don't have noindex on /latest/
expect(
doc
.querySelectorAll('meta')
.where(
doc.querySelectorAll('meta').where(
(m) =>
m.attributes['name'] == 'robots' &&
m.attributes['content'] == 'noindex',
Expand Down Expand Up @@ -133,8 +131,8 @@ Future<void> _traverseLinksUnderPath({
final r = relativeTo.resolveUri(u);
return r.path;
};
final isUnderRoots = (String path) =>
roots.any((root) => path.startsWith(root));
final isUnderRoots =
(String path) => roots.any((root) => path.startsWith(root));

final visited = <String>{};
// HTML pages to visit
Expand All @@ -152,7 +150,8 @@ Future<void> _traverseLinksUnderPath({
final res = await issueGet(target.toString(), headers: _headers);
if (res.statusCode == 303) {
htmlQueue.addAll(
[normalize(res.headers['location']!, target)].nonNulls
[normalize(res.headers['location']!, target)]
.nonNulls
.whereNot(visited.contains)
.whereNot(htmlQueue.contains)
.whereNot(assetQueue.contains),
Expand Down
Loading