-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes err.url is undefined. so It must has protect code. #893
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,4 +66,21 @@ describe('Page does not use Date.now()', () => { | |
assert.equal(auditResult.rawValue, false); | ||
assert.equal(auditResult.extendedInfo.value.length, 2); | ||
}); | ||
|
||
it('fails when usage hasn`t url', () => { | ||
const auditResult = DateNowUseAudit.audit({ | ||
DateNowUse: { | ||
usage: [ | ||
{line: 1, col: 1}, | ||
{url: 'http://example.com/two', line: 10, col: 1}, | ||
{url: 'http://example2.com/two', line: 2, col: 22} | ||
] | ||
}, | ||
URL: {finalUrl: URL}, | ||
}); | ||
|
||
assert.equal(auditResult.rawValue, false); | ||
assert.ok(auditResult.extendedInfo.value[0].url === ''); | ||
assert.equal(auditResult.extendedInfo.value.length, 2); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you check that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ebidel |
||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,4 +48,14 @@ describe('Page does not use mutation events', () => { | |
assert.equal(auditResult.rawValue, false); | ||
assert.equal(auditResult.extendedInfo.value.length, 3); | ||
}); | ||
|
||
it('fails when listener hasn`t url', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fails when listener is missing a url property There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DONE! |
||
const auditResult = NoMutationEventsAudit.audit({ | ||
PageLevelEventListeners: fixtureData, | ||
URL: {finalUrl: URL}, | ||
}); | ||
assert.equal(auditResult.rawValue, false); | ||
assert.ok(auditResult.extendedInfo.value[1].url === undefined); | ||
assert.equal(auditResult.extendedInfo.value.length, 3); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,4 +69,14 @@ describe('Page uses passive events listeners where applicable', () => { | |
assert.equal(auditResult.rawValue, true); | ||
assert.equal(auditResult.extendedInfo.value.length, 0); | ||
}); | ||
|
||
it('fails when listener hasn`t url', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fails when listener is missing a url property There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DONE! |
||
const auditResult = PassiveEventsAudit.audit({ | ||
PageLevelEventListeners: fixtureData, | ||
URL: {finalUrl: URL}, | ||
}); | ||
assert.equal(auditResult.rawValue, false); | ||
assert.ok(auditResult.extendedInfo.value[1].url === undefined); | ||
assert.equal(auditResult.extendedInfo.value.length, 5); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe "only passes when has url property"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE!