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

docs(integration-tests): using Lighthouse with Jest; verify in our CI #9722

Merged
merged 61 commits into from
Nov 20, 2019

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Sep 23, 2019

split out from #9628

"test": "jest example-lh-auth.test.js"
},
"dependencies": {
"jest": "^24.9.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also tried to just use ../../../node_modules/.bin/jest, but we are some versions behind and are missing this.utils.DIM_COLOR.

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

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

this PR does two things

  1. docs example of using jest with LH & pptr
  2. validates that jest example works in CI

should call that out in the title or description.

nits here and there.

docs/recipes/integration-test/README.md Outdated Show resolved Hide resolved
docs/recipes/integration-test/example-lh-auth.test.js Outdated Show resolved Hide resolved
* @return {Promise<LH.Result>}
*/
async function runLighthouse(url) {
const result = await lighthouse(url, {
Copy link
Member

Choose a reason for hiding this comment

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

shouldnt this also be the impl in example-lh-auth.js ?

that way this file is just tests and no extra stuff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function is short and very relevant to running Lighthouse in tests, so I think it should be here.

Copy link
Member

Choose a reason for hiding this comment

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

k sg

docs/recipes/integration-test/example-lh-auth.test.js Outdated Show resolved Hide resolved
docs/recipes/integration-test/example-lh-auth.test.js Outdated Show resolved Hide resolved
docs/recipes/integration-test/example-lh-auth.test.js Outdated Show resolved Hide resolved
docs/recipes/integration-test/example-lh-auth.test.js Outdated Show resolved Hide resolved
@connorjclark connorjclark changed the title docs(integration-tests): how to use Lighthouse with Jest docs(integration-tests): using Lighthouse with Jest; verify in our CI Nov 20, 2019
Co-Authored-By: Paul Irish <paulirish@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants