-
Notifications
You must be signed in to change notification settings - Fork 362
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
feat: Lighthouse stringify extension #272
Conversation
@@ -56,6 +56,7 @@ | |||
"eslint-config-prettier": "8.5.0", | |||
"eslint-plugin-prettier": "4.0.0", | |||
"eslint-plugin-tsdoc": "0.2.16", | |||
"lighthouse": "9.5.0-dev.20220818", |
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.
The output scripts require features in LH 10.0. This dep is only used for testing so it should be fine to use a preview build.
extension: new LighthouseStringifyExtension(), | ||
}); | ||
|
||
// Trim the output to the relevant stuff |
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.
should we extract a helper function for trimming? Also, perhaps, it's better to search for await browser.close()
to avoid the dangling await
in the snapshot?
assert.strictEqual(stdout, ''); | ||
assert.strictEqual(stderr, ''); | ||
|
||
const reportHtml = fs.readFileSync( |
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.
this is nice! we need to do that for the regular stringify extension and combine it with #268 to have better coverage
Should be pretty much the same as GoogleChrome/lighthouse#14146
FWIW I think some version of the e2e tester could be useful for the more generic
PuppeteerStringifyExtension
. The e2e tester is what helped me catch the bug from #261.