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

eviscerate runLighthouse #1

Merged
merged 1 commit into from
Nov 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions clients/devtools-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,6 @@ function setUpWorkerConnection(port) {
return new RawProtocol(port);
}

/**
* @param {string} url
* @param {LH.Flags} flags Lighthouse flags.
* @param {Array<string>} categoryIDs Name values of categories to include.
* @param {RawProtocol} connection
* @return {Promise<LH.RunnerResult|void>}
*/
function runLighthouse(url, flags, categoryIDs, connection) {
// Default to 'info' logging level.
flags.logLevel = flags.logLevel || 'info';
flags.channel = 'devtools';
const config = getDefaultConfigForCategories(categoryIDs);
return lighthouse(url, flags, config, connection);
}

/** @param {(status: [string, string, string]) => void} listenCallback */
function listenForStatus(listenCallback) {
log.events.addListener('status', listenCallback);
Expand All @@ -59,7 +44,8 @@ if (typeof module !== 'undefined' && module.exports) {
// export for require()ing (via browserify).
module.exports = {
setUpWorkerConnection,
runLighthouse,
lighthouse,
getDefaultConfigForCategories,
listenForStatus,
registerLocaleData,
lookupLocale,
Expand All @@ -72,7 +58,9 @@ if (typeof self !== 'undefined') {
// @ts-ignore
self.setUpWorkerConnection = setUpWorkerConnection;
// @ts-ignore
self.runLighthouse = runLighthouse;
self.runLighthouse = lighthouse;
// @ts-ignore
self.getDefaultConfigForCategories = getDefaultConfigForCategories;
// @ts-ignore
self.listenForStatus = listenForStatus;
// @ts-ignore
Expand Down