Skip to content
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

Merged
merged 1 commit into from
Dec 21, 2018
Merged

Conversation

connorjclark
Copy link
Collaborator

errorCode wasn't being asserted for smoke tests. with this code, it will be. fin.

only effects the errors smoke tests

Copy link
Collaborator

@patrickhulce patrickhulce left a 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
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param {{finalUrl: string, audits: !Array, errorCode: string}} actual
* @param {{finalUrl: string, audits: Array, errorCode?: string}} actual

Copy link
Collaborator

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...

Copy link
Collaborator Author

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.

@brendankenny brendankenny changed the title test(smoke): assert errorCode in expectations tests(smoke): assert errorCode in expectations Dec 21, 2018
Copy link
Member

@brendankenny brendankenny left a 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

@brendankenny
Copy link
Member

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 :)

@brendankenny brendankenny merged commit e52ee0c into master Dec 21, 2018
@brendankenny brendankenny deleted the error-code-smoke branch December 21, 2018 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants