-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core: replace remaining rawValue with numericValue #8421
Conversation
@@ -26,7 +26,7 @@ describe('Performance: first-contentful-paint-3g audit', () => { | |||
|
|||
const result = await FCP3G.audit(artifacts, {settings: {}, options, computedCache: new Map()}); | |||
// Use InlineSnapshot here so changes to Lantern coefficients can be easily updated en masse |
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.
:roll_eyes:
:P
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.
oh puh-lease 😛 there's like 40 freaking values to manually and copy and paste when lantern changes and I've had to do it like 8 times. do you want to volunteer to manually fix every expectation every time this happens from here on out?
@@ -75,8 +75,7 @@ describe('PWA: load-fast-enough-for-pwa audit', () => { | |||
|
|||
const settings = {throttlingMethod: 'provided', throttling: {rttMs: 40, throughput: 100000}}; | |||
const result = await FastPWAAudit.audit(artifacts, {settings, computedCache: new Map()}); | |||
expect(result.rawValue).toBeGreaterThan(2000); // If not overridden this would be 1582 | |||
expect(Math.round(result.rawValue)).toMatchSnapshot(); |
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.
wasn't sure why this was this way, but just a single number, so removed
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.
@brendankenny it's a lantern computed value it does it this way so that lantern changes can be updated with -u
in jest
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.
could you revert with a comment?
@@ -75,8 +75,7 @@ describe('PWA: load-fast-enough-for-pwa audit', () => { | |||
|
|||
const settings = {throttlingMethod: 'provided', throttling: {rttMs: 40, throughput: 100000}}; | |||
const result = await FastPWAAudit.audit(artifacts, {settings, computedCache: new Map()}); | |||
expect(result.rawValue).toBeGreaterThan(2000); // If not overridden this would be 1582 | |||
expect(Math.round(result.rawValue)).toMatchSnapshot(); |
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.
@brendankenny it's a lantern computed value it does it this way so that lantern changes can be updated with -u
in jest
@@ -75,8 +75,7 @@ describe('PWA: load-fast-enough-for-pwa audit', () => { | |||
|
|||
const settings = {throttlingMethod: 'provided', throttling: {rttMs: 40, throughput: 100000}}; | |||
const result = await FastPWAAudit.audit(artifacts, {settings, computedCache: new Map()}); | |||
expect(result.rawValue).toBeGreaterThan(2000); // If not overridden this would be 1582 | |||
expect(Math.round(result.rawValue)).toMatchSnapshot(); |
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.
could you revert with a comment?
@@ -26,7 +26,7 @@ describe('Performance: first-contentful-paint-3g audit', () => { | |||
|
|||
const result = await FCP3G.audit(artifacts, {settings: {}, options, computedCache: new Map()}); | |||
// Use InlineSnapshot here so changes to Lantern coefficients can be easily updated en masse |
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.
oh puh-lease 😛 there's like 40 freaking values to manually and copy and paste when lantern changes and I've had to do it like 8 times. do you want to volunteer to manually fix every expectation every time this happens from here on out?
In memoriam: The earliest reference to Also we were going to have The types landed a day later in the great Aggregator PR from @paullewis. At that point, audits had a
|
@@ -37,7 +37,7 @@ class PreloadAsAudit extends Audit { | |||
const passed = noAsLinks.length === 0; | |||
|
|||
return { | |||
rawValue: passed, | |||
score: passed ? 1 : 0, |
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.
+passed
? idk how hacky you'll allow js to be :)
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.
I did something like Number(passed)
for real audits, but since this is a recipe I thought I'd be more explicit. Not sure if this is actually more self explanatory, though :)
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.
I like the explicitness of this for the recipe :)
@patrickhulce you're still requesting changes |
Oh my bad sorry thought I came back to this already :) |
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.
LGTM
part 3 of 3 after #8343 and #8385
Replaces
rawValue
withnumericValue
in the internal audit output (LH.Audit.Product
). Went suspiciously easily :)fixes #6199