-
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
tests(smoke): assert errorCode in expectations #6851
Conversation
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.
Ha, oops :)
LGTM!
@@ -274,11 +280,12 @@ function reportAssertion(assertion) { | |||
/** | |||
* Log all the comparisons between actual and expected test results, then print | |||
* summary. Returns count of passed and failed tests. | |||
* @param {{finalUrl: !Object, audits: !Array<!Object>}} results | |||
* @param {{finalUrl: !Object, audits: !Array<!Object>, errorCode: !Object}} results |
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.
FWIW, we don't need all these !
anymore, so it'd be cool to be cleaning them up as we go if we can, but I don't think any of the comments are real atm
@@ -199,8 +199,8 @@ function findDifference(path, actual, expected) { | |||
|
|||
/** | |||
* Collate results into comparisons of actual and expected scores on each audit. | |||
* @param {{finalUrl: string, audits: !Array}} actual | |||
* @param {{finalUrl: string, audits: !Array}} expected | |||
* @param {{finalUrl: string, audits: !Array, errorCode: string}} actual |
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.
* @param {{finalUrl: string, audits: !Array, errorCode: string}} actual | |
* @param {{finalUrl: string, audits: Array, errorCode?: string}} actual |
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 don't think these files are actually type checked though, audits isn't an Array
...
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.
Hah, it certainly isn't. Opened #6852.
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.
LGTM2
All the annotations are super ancient and were for Closure, and definitely weren't updated as the LHR took form. We can address all in one go for #6852
we should also be asserting the LHR form rather than the audit results and a few properties moved to the top level, but also for another day :) |
errorCode
wasn't being asserted for smoke tests. with this code, it will be. fin.only effects the
errors
smoke tests