[go: nahoru, domu]

Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Aug 9, 2023
1 parent 86b9602 commit 4210ece
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/lib/dependency-graph/simulator/network-analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ class NetworkAnalyzer {
// equalWithExcludedFragments is expensive, so check that the resourceUrl starts with the request url first
const matchingRequests = records.filter(request =>
request.resourceType === 'Document' &&
// Note: `request.url` should never have a fragment, else this optimization gives wrong results.
resourceUrl.startsWith(request.url) &&
UrlUtils.equalWithExcludedFragments(request.url, resourceUrl)
);
Expand Down
5 changes: 3 additions & 2 deletions core/test/computed/main-resource-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('MainResource computed artifact', () => {
const networkRecords = [
{url: 'https://example.com'},
{url: 'https://example.com/sw.js'},
{url: 'https://example.com#pickme'},
{url: 'https://example.com', resourceType: 'Document', failed: true},
];

const URL = {mainDocumentUrl: 'https://example.com'};
Expand All @@ -85,7 +85,8 @@ describe('MainResource computed artifact', () => {

const context = {computedCache: new Map()};
return MainResource.request(artifacts, context).then(output => {
assert.equal(output.url, 'https://example.com#pickme');
assert.equal(output.url, 'https://example.com');
assert.equal(output.failed, true);
});
});
});

0 comments on commit 4210ece

Please sign in to comment.