diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index ed7204650cfb..9f131fe5e0d1 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -149,7 +149,7 @@ jobs: run: bash $GITHUB_WORKSPACE/core/scripts/download-chrome.sh && mv chrome-linux chrome-linux-tot - run: sudo apt-get install xvfb - - name: yarn smoke --fraggle-rock + - name: yarn smoke --legacy-navigation run: xvfb-run --auto-servernum yarn smoke --debug --legacy-navigation -j=2 --retries=2 --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL # Fail if any changes were written to source files. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 755c3ec91e2f..e2eccca3a91a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -128,7 +128,7 @@ accept your pull requests. ## Tracking Errors -We track our errors in the wild with Sentry. In general, do not worry about wrapping your audits or gatherers in try/catch blocks and reporting every error that could possibly occur; `core/runner.js` and `core/fraggle-rock/gather/*-runner.js` already catch and report any errors that occur while running a gatherer or audit, including errors fatal to the entire run. However, there are some situations when you might want to explicitly handle an error and report it to Sentry or wrap it to avoid reporting. Generally, you can interact with Sentry simply by requiring the `core/lib/sentry.js` file and call its methods. The module exports a delegate that will correctly handle the error reporting based on the user's opt-in preference and will simply no-op if they haven't so you don't need to check. +We track our errors in the wild with Sentry. In general, do not worry about wrapping your audits or gatherers in try/catch blocks and reporting every error that could possibly occur; `core/runner.js` and `core/gather/*-runner.js` already catch and report any errors that occur while running a gatherer or audit, including errors fatal to the entire run. However, there are some situations when you might want to explicitly handle an error and report it to Sentry or wrap it to avoid reporting. Generally, you can interact with Sentry simply by requiring the `core/lib/sentry.js` file and call its methods. The module exports a delegate that will correctly handle the error reporting based on the user's opt-in preference and will simply no-op if they haven't so you don't need to check. #### If you have an expected error that is recoverable but want to track how frequently it happens, *use Sentry.captureException*. diff --git a/cli/bin.js b/cli/bin.js index f09c3e759017..8fee8fdb9982 100644 --- a/cli/bin.js +++ b/cli/bin.js @@ -31,7 +31,7 @@ import {generateConfig, generateLegacyConfig} from '../core/index.js'; import {askPermission} from './sentry-prompt.js'; import {LH_ROOT} from '../root.js'; import {Sentry} from '../core/lib/sentry.js'; -import {getConfigDisplayString} from '../core/fraggle-rock/config/config.js'; +import {getConfigDisplayString} from '../core/config/config.js'; const pkg = JSON.parse(fs.readFileSync(LH_ROOT + '/package.json', 'utf-8')); diff --git a/clients/devtools/devtools-entry.js b/clients/devtools/devtools-entry.js index a83222239783..dc222ac63b44 100644 --- a/clients/devtools/devtools-entry.js +++ b/clients/devtools/devtools-entry.js @@ -11,7 +11,7 @@ import {Buffer} from 'buffer'; import log from 'lighthouse-logger'; import lighthouse, {legacyNavigation} from '../../core/index.js'; -import {navigation, startTimespan, snapshot} from '../../core/fraggle-rock/api.js'; +import {navigation, startTimespan, snapshot} from '../../core/api.js'; import {RawConnection} from '../../core/legacy/gather/connections/raw.js'; import {lookupLocale} from '../../core/lib/i18n/i18n.js'; import {registerLocaleData, getCanonicalLocales} from '../../shared/localization/format.js'; diff --git a/core/fraggle-rock/api.js b/core/api.js similarity index 95% rename from core/fraggle-rock/api.js rename to core/api.js index 439fbd5d60b8..9fdaa7d72608 100644 --- a/core/fraggle-rock/api.js +++ b/core/api.js @@ -8,8 +8,8 @@ import {UserFlow, auditGatherSteps} from './user-flow.js'; import {snapshotGather} from './gather/snapshot-runner.js'; import {startTimespanGather} from './gather/timespan-runner.js'; import {navigationGather} from './gather/navigation-runner.js'; -import {ReportGenerator} from '../../report/generator/report-generator.js'; -import {Runner} from '../runner.js'; +import {ReportGenerator} from '../report/generator/report-generator.js'; +import {Runner} from './runner.js'; /** * @param {LH.Puppeteer.Page} page diff --git a/core/config/config-helpers.js b/core/config/config-helpers.js index 3a5a2f02603e..4e4c0c28e4ba 100644 --- a/core/config/config-helpers.js +++ b/core/config/config-helpers.js @@ -14,7 +14,7 @@ import {Budget} from './budget.js'; import ConfigPlugin from './config-plugin.js'; import {Runner} from '../runner.js'; import * as i18n from '../lib/i18n/i18n.js'; -import * as validation from '../fraggle-rock/config/validation.js'; +import * as validation from './validation.js'; import {getModuleDirectory} from '../../esm-utils.js'; const require = createRequire(import.meta.url); diff --git a/core/fraggle-rock/config/config.js b/core/config/config.js similarity index 96% rename from core/fraggle-rock/config/config.js rename to core/config/config.js index 53aad0b1eb4d..934ccc910b41 100644 --- a/core/fraggle-rock/config/config.js +++ b/core/config/config.js @@ -8,9 +8,9 @@ import path from 'path'; import log from 'lighthouse-logger'; -import {Runner} from '../../runner.js'; -import defaultConfig from '../../config/default-config.js'; -import {defaultNavigationConfig, nonSimulatedPassConfigOverrides} from '../../config/constants.js'; // eslint-disable-line max-len +import {Runner} from '../runner.js'; +import defaultConfig from './default-config.js'; +import {defaultNavigationConfig, nonSimulatedPassConfigOverrides} from './constants.js'; // eslint-disable-line max-len import { isFRGathererDefn, throwInvalidDependencyOrder, @@ -28,9 +28,9 @@ import { mergePlugins, mergeConfigFragment, mergeConfigFragmentArrayByKey, -} from '../../config/config-helpers.js'; -import {getModuleDirectory} from '../../../esm-utils.js'; -import * as format from '../../../shared/localization/format.js'; +} from './config-helpers.js'; +import {getModuleDirectory} from '../../esm-utils.js'; +import * as format from '../../shared/localization/format.js'; const defaultConfigPath = path.join( getModuleDirectory(import.meta), diff --git a/core/fraggle-rock/config/filters.js b/core/config/filters.js similarity index 99% rename from core/fraggle-rock/config/filters.js rename to core/config/filters.js index 1120aca937e5..3fe40e319241 100644 --- a/core/fraggle-rock/config/filters.js +++ b/core/config/filters.js @@ -6,7 +6,7 @@ import log from 'lighthouse-logger'; -import {Audit} from '../../audits/audit.js'; +import {Audit} from '../audits/audit.js'; /** @type {Record} */ const baseArtifactKeySource = { diff --git a/core/fraggle-rock/config/validation.js b/core/config/validation.js similarity index 99% rename from core/fraggle-rock/config/validation.js rename to core/config/validation.js index 0143d3f471f4..b345d4d44abe 100644 --- a/core/fraggle-rock/config/validation.js +++ b/core/config/validation.js @@ -4,9 +4,9 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {Audit} from '../../audits/audit.js'; +import {Audit} from '../audits/audit.js'; import BaseFRGatherer from '../gather/base-gatherer.js'; -import * as i18n from '../../lib/i18n/i18n.js'; +import * as i18n from '../lib/i18n/i18n.js'; /** * @param {LH.Config.GathererDefn | LH.Config.AnyFRGathererDefn} gathererDefn diff --git a/core/fraggle-rock/gather/base-artifacts.js b/core/gather/base-artifacts.js similarity index 98% rename from core/fraggle-rock/gather/base-artifacts.js rename to core/gather/base-artifacts.js index 535940c56f25..376f2791ebd5 100644 --- a/core/fraggle-rock/gather/base-artifacts.js +++ b/core/gather/base-artifacts.js @@ -9,7 +9,7 @@ import isDeepEqual from 'lodash/isEqual.js'; import { getBrowserVersion, getBenchmarkIndex, getEnvironmentWarnings, -} from '../../gather/driver/environment.js'; +} from './driver/environment.js'; /** * @param {LH.Config.FRConfig} config diff --git a/core/fraggle-rock/gather/base-gatherer.js b/core/gather/base-gatherer.js similarity index 100% rename from core/fraggle-rock/gather/base-gatherer.js rename to core/gather/base-gatherer.js diff --git a/core/fraggle-rock/gather/driver.js b/core/gather/driver.js similarity index 93% rename from core/fraggle-rock/gather/driver.js rename to core/gather/driver.js index 40f7518b4172..25b8e9d0af21 100644 --- a/core/fraggle-rock/gather/driver.js +++ b/core/gather/driver.js @@ -6,9 +6,9 @@ import log from 'lighthouse-logger'; -import {ExecutionContext} from '../../gather/driver/execution-context.js'; -import {TargetManager} from '../../gather/driver/target-manager.js'; -import {Fetcher} from '../../gather/fetcher.js'; +import {ExecutionContext} from './driver/execution-context.js'; +import {TargetManager} from './driver/target-manager.js'; +import {Fetcher} from './fetcher.js'; /** @return {*} */ const throwNotConnectedFn = () => { diff --git a/core/gather/driver/target-manager.js b/core/gather/driver/target-manager.js index de6b0b847fc7..9f2f68a8bfc5 100644 --- a/core/gather/driver/target-manager.js +++ b/core/gather/driver/target-manager.js @@ -13,7 +13,7 @@ import EventEmitter from 'events'; import log from 'lighthouse-logger'; -import {ProtocolSession} from '../../fraggle-rock/gather/session.js'; +import {ProtocolSession} from '../session.js'; /** * @typedef {{ diff --git a/core/gather/gatherers/accessibility.js b/core/gather/gatherers/accessibility.js index fd8f0af908c0..1dfdc62d9a12 100644 --- a/core/gather/gatherers/accessibility.js +++ b/core/gather/gatherers/accessibility.js @@ -6,7 +6,7 @@ /* global window, document, getNodeDetails */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {axeSource} from '../../lib/axe.js'; import {pageFunctions} from '../../lib/page-functions.js'; diff --git a/core/gather/gatherers/anchor-elements.js b/core/gather/gatherers/anchor-elements.js index 3d35338c2949..218e2ff89b73 100644 --- a/core/gather/gatherers/anchor-elements.js +++ b/core/gather/gatherers/anchor-elements.js @@ -6,7 +6,7 @@ /* global getNodeDetails */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {pageFunctions} from '../../lib/page-functions.js'; import {resolveDevtoolsNodePathToObjectId} from '../driver/dom.js'; diff --git a/core/gather/gatherers/cache-contents.js b/core/gather/gatherers/cache-contents.js index 8d8909c858a1..5472131542cc 100644 --- a/core/gather/gatherers/cache-contents.js +++ b/core/gather/gatherers/cache-contents.js @@ -6,7 +6,7 @@ /* global caches */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; /** * @return {Promise>} diff --git a/core/gather/gatherers/console-messages.js b/core/gather/gatherers/console-messages.js index 320aecf0bcaf..2f0b7e35b887 100644 --- a/core/gather/gatherers/console-messages.js +++ b/core/gather/gatherers/console-messages.js @@ -10,7 +10,7 @@ */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; /** * @param {LH.Crdp.Runtime.RemoteObject} obj diff --git a/core/gather/gatherers/css-usage.js b/core/gather/gatherers/css-usage.js index abeb77307ab7..c4e4cea3b89d 100644 --- a/core/gather/gatherers/css-usage.js +++ b/core/gather/gatherers/css-usage.js @@ -10,7 +10,7 @@ import log from 'lighthouse-logger'; -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {Sentry} from '../../lib/sentry.js'; class CSSUsage extends FRGatherer { diff --git a/core/gather/gatherers/devtools-log-compat.js b/core/gather/gatherers/devtools-log-compat.js index 8f06de7f5fa0..88b3581f34d6 100644 --- a/core/gather/gatherers/devtools-log-compat.js +++ b/core/gather/gatherers/devtools-log-compat.js @@ -11,7 +11,7 @@ */ import DevtoolsLogGatherer from './devtools-log.js'; -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; /** @implements {LH.Gatherer.FRGathererInstance<'DevtoolsLog'>} */ class DevtoolsLogCompat extends FRGatherer { diff --git a/core/gather/gatherers/devtools-log.js b/core/gather/gatherers/devtools-log.js index d321f5c8b9c4..14ed5cf2f414 100644 --- a/core/gather/gatherers/devtools-log.js +++ b/core/gather/gatherers/devtools-log.js @@ -10,7 +10,7 @@ * This protocol log can be used to recreate the network records using lib/network-recorder.js. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; class DevtoolsLog extends FRGatherer { static symbol = Symbol('DevtoolsLog'); diff --git a/core/gather/gatherers/dobetterweb/doctype.js b/core/gather/gatherers/dobetterweb/doctype.js index 763b2efecc0a..0ce67217661f 100644 --- a/core/gather/gatherers/dobetterweb/doctype.js +++ b/core/gather/gatherers/dobetterweb/doctype.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; /* global document */ diff --git a/core/gather/gatherers/dobetterweb/domstats.js b/core/gather/gatherers/dobetterweb/domstats.js index 0fdd9f82941b..e5d90121dad1 100644 --- a/core/gather/gatherers/dobetterweb/domstats.js +++ b/core/gather/gatherers/dobetterweb/domstats.js @@ -12,7 +12,7 @@ /* global getNodeDetails document */ -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; import {pageFunctions} from '../../../lib/page-functions.js'; /** diff --git a/core/gather/gatherers/dobetterweb/optimized-images.js b/core/gather/gatherers/dobetterweb/optimized-images.js index 370666548fe7..d3adfdee0883 100644 --- a/core/gather/gatherers/dobetterweb/optimized-images.js +++ b/core/gather/gatherers/dobetterweb/optimized-images.js @@ -12,7 +12,7 @@ import log from 'lighthouse-logger'; -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; import UrlUtils from '../../../lib/url-utils.js'; import {NetworkRequest} from '../../../lib/network-request.js'; import {Sentry} from '../../../lib/sentry.js'; diff --git a/core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js b/core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js index 83e32f8a860a..785f25ac5e24 100644 --- a/core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js +++ b/core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js @@ -6,7 +6,7 @@ /* global document ClipboardEvent getNodeDetails */ -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; import {pageFunctions} from '../../../lib/page-functions.js'; /** diff --git a/core/gather/gatherers/dobetterweb/response-compression.js b/core/gather/gatherers/dobetterweb/response-compression.js index 330b5443826a..3af8d6970edd 100644 --- a/core/gather/gatherers/dobetterweb/response-compression.js +++ b/core/gather/gatherers/dobetterweb/response-compression.js @@ -13,7 +13,7 @@ import {Buffer} from 'buffer'; import {gzip} from 'zlib'; -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; import UrlUtils from '../../../lib/url-utils.js'; import {Sentry} from '../../../lib/sentry.js'; import {NetworkRequest} from '../../../lib/network-request.js'; diff --git a/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js b/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js index 72f0a42b20e6..f30dba9c5089 100644 --- a/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +++ b/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js @@ -19,7 +19,7 @@ import {NetworkRecords} from '../../../computed/network-records.js'; import DevtoolsLog from '../devtools-log.js'; -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; /* global document, window, HTMLLinkElement, SVGScriptElement */ diff --git a/core/gather/gatherers/full-page-screenshot.js b/core/gather/gatherers/full-page-screenshot.js index 6f3a3fcbb56c..06edd7aec9b1 100644 --- a/core/gather/gatherers/full-page-screenshot.js +++ b/core/gather/gatherers/full-page-screenshot.js @@ -6,7 +6,7 @@ /* globals window document getBoundingClientRect requestAnimationFrame */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import * as emulation from '../../lib/emulation.js'; import {pageFunctions} from '../../lib/page-functions.js'; import {NetworkMonitor} from '../driver/network-monitor.js'; diff --git a/core/gather/gatherers/global-listeners.js b/core/gather/gatherers/global-listeners.js index 007e7b685ca2..38f5eb4ca45a 100644 --- a/core/gather/gatherers/global-listeners.js +++ b/core/gather/gatherers/global-listeners.js @@ -11,7 +11,7 @@ * around page unload, but this can be expanded in the future. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; class GlobalListeners extends FRGatherer { /** @type {LH.Gatherer.GathererMeta} */ diff --git a/core/gather/gatherers/iframe-elements.js b/core/gather/gatherers/iframe-elements.js index 3e00241675e8..e30df63c3fa5 100644 --- a/core/gather/gatherers/iframe-elements.js +++ b/core/gather/gatherers/iframe-elements.js @@ -6,7 +6,7 @@ /* global getNodeDetails */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {pageFunctions} from '../../lib/page-functions.js'; /* eslint-env browser, node */ diff --git a/core/gather/gatherers/image-elements.js b/core/gather/gatherers/image-elements.js index 82e2ee84f764..f75ebdb92d5a 100644 --- a/core/gather/gatherers/image-elements.js +++ b/core/gather/gatherers/image-elements.js @@ -11,7 +11,7 @@ import log from 'lighthouse-logger'; -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {pageFunctions} from '../../lib/page-functions.js'; import * as FontSize from './seo/font-size.js'; diff --git a/core/gather/gatherers/inputs.js b/core/gather/gatherers/inputs.js index 3f0c020737dd..2f004cd04baa 100644 --- a/core/gather/gatherers/inputs.js +++ b/core/gather/gatherers/inputs.js @@ -6,7 +6,7 @@ /* global getNodeDetails */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {pageFunctions} from '../../lib/page-functions.js'; /* eslint-env browser, node */ diff --git a/core/gather/gatherers/inspector-issues.js b/core/gather/gatherers/inspector-issues.js index 334c3473860b..7553641e83fd 100644 --- a/core/gather/gatherers/inspector-issues.js +++ b/core/gather/gatherers/inspector-issues.js @@ -9,7 +9,7 @@ */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {NetworkRecords} from '../../computed/network-records.js'; import DevtoolsLog from './devtools-log.js'; diff --git a/core/gather/gatherers/installability-errors.js b/core/gather/gatherers/installability-errors.js index c975572c1449..f591be191601 100644 --- a/core/gather/gatherers/installability-errors.js +++ b/core/gather/gatherers/installability-errors.js @@ -6,7 +6,7 @@ import log from 'lighthouse-logger'; -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; class InstallabilityErrors extends FRGatherer { /** @type {LH.Gatherer.GathererMeta} */ diff --git a/core/gather/gatherers/js-usage.js b/core/gather/gatherers/js-usage.js index 78f1d7c4b280..1f9d5e2c150e 100644 --- a/core/gather/gatherers/js-usage.js +++ b/core/gather/gatherers/js-usage.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; /** * @fileoverview Tracks unused JavaScript diff --git a/core/gather/gatherers/link-elements.js b/core/gather/gatherers/link-elements.js index 002321835bd7..875c81fec58a 100644 --- a/core/gather/gatherers/link-elements.js +++ b/core/gather/gatherers/link-elements.js @@ -6,7 +6,7 @@ import LinkHeader from 'http-link-header'; -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {pageFunctions} from '../../lib/page-functions.js'; import DevtoolsLog from './devtools-log.js'; import {MainResource} from '../../computed/main-resource.js'; diff --git a/core/gather/gatherers/main-document-content.js b/core/gather/gatherers/main-document-content.js index 2f672277f550..6eaf74ee63ef 100644 --- a/core/gather/gatherers/main-document-content.js +++ b/core/gather/gatherers/main-document-content.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import DevtoolsLog from './devtools-log.js'; import {fetchResponseBodyFromCache} from '../driver/network.js'; import {MainResource} from '../../computed/main-resource.js'; diff --git a/core/gather/gatherers/meta-elements.js b/core/gather/gatherers/meta-elements.js index 17e01c542e17..bd874aee9dee 100644 --- a/core/gather/gatherers/meta-elements.js +++ b/core/gather/gatherers/meta-elements.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {pageFunctions} from '../../lib/page-functions.js'; /* globals getElementsInDocument getNodeDetails */ diff --git a/core/gather/gatherers/network-user-agent.js b/core/gather/gatherers/network-user-agent.js index 464a6fe3ef0a..ebcd6f04c78c 100644 --- a/core/gather/gatherers/network-user-agent.js +++ b/core/gather/gatherers/network-user-agent.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import DevtoolsLogGatherer from './devtools-log.js'; /** @implements {LH.Gatherer.FRGathererInstance<'DevtoolsLog'>} */ diff --git a/core/gather/gatherers/script-elements.js b/core/gather/gatherers/script-elements.js index 3d12db41080b..a3e66ecf4493 100644 --- a/core/gather/gatherers/script-elements.js +++ b/core/gather/gatherers/script-elements.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {NetworkRecords} from '../../computed/network-records.js'; import {NetworkRequest} from '../../lib/network-request.js'; import {pageFunctions} from '../../lib/page-functions.js'; diff --git a/core/gather/gatherers/scripts.js b/core/gather/gatherers/scripts.js index 0d907f22bef0..69e78bd8ef5a 100644 --- a/core/gather/gatherers/scripts.js +++ b/core/gather/gatherers/scripts.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; /** * @template T, U diff --git a/core/gather/gatherers/seo/embedded-content.js b/core/gather/gatherers/seo/embedded-content.js index 313ce2ecbcf1..4ea38c087316 100644 --- a/core/gather/gatherers/seo/embedded-content.js +++ b/core/gather/gatherers/seo/embedded-content.js @@ -6,7 +6,7 @@ /* globals getElementsInDocument getNodeDetails */ -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; import {pageFunctions} from '../../../lib/page-functions.js'; /** diff --git a/core/gather/gatherers/seo/font-size.js b/core/gather/gatherers/seo/font-size.js index 33d56e416973..634665ed815c 100644 --- a/core/gather/gatherers/seo/font-size.js +++ b/core/gather/gatherers/seo/font-size.js @@ -15,7 +15,7 @@ * This gatherer collects stylesheet metadata by itself, instead of relying on the styles gatherer which is slow (because it parses the stylesheet content). */ -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; const FONT_SIZE_PROPERTY_NAME = 'font-size'; const MINIMAL_LEGIBLE_FONT_SIZE_PX = 12; diff --git a/core/gather/gatherers/seo/robots-txt.js b/core/gather/gatherers/seo/robots-txt.js index f19859ecab7e..75f430ae50c4 100644 --- a/core/gather/gatherers/seo/robots-txt.js +++ b/core/gather/gatherers/seo/robots-txt.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; class RobotsTxt extends FRGatherer { /** @type {LH.Gatherer.GathererMeta} */ diff --git a/core/gather/gatherers/seo/tap-targets.js b/core/gather/gatherers/seo/tap-targets.js index 33668bb508b2..3aecd272efc7 100644 --- a/core/gather/gatherers/seo/tap-targets.js +++ b/core/gather/gatherers/seo/tap-targets.js @@ -6,7 +6,7 @@ /* global document, window, getComputedStyle, getElementsInDocument, Node, getNodeDetails, getRectCenterPoint */ -import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../../base-gatherer.js'; import {pageFunctions} from '../../../lib/page-functions.js'; import * as RectHelpers from '../../../lib/rect-helpers.js'; diff --git a/core/gather/gatherers/service-worker.js b/core/gather/gatherers/service-worker.js index 32ce470f887e..af933bf150f7 100644 --- a/core/gather/gatherers/service-worker.js +++ b/core/gather/gatherers/service-worker.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import * as serviceWorkers from '../driver/service-workers.js'; class ServiceWorker extends FRGatherer { diff --git a/core/gather/gatherers/source-maps.js b/core/gather/gatherers/source-maps.js index 77846fb8a95f..8da6065c3864 100644 --- a/core/gather/gatherers/source-maps.js +++ b/core/gather/gatherers/source-maps.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; /** * @fileoverview Gets JavaScript source maps. diff --git a/core/gather/gatherers/stacks.js b/core/gather/gatherers/stacks.js index e917ebc64f8e..a8c62fb2412b 100644 --- a/core/gather/gatherers/stacks.js +++ b/core/gather/gatherers/stacks.js @@ -16,7 +16,7 @@ import {createRequire} from 'module'; import log from 'lighthouse-logger'; -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; // This is removed by rollup, because the only usage is to resolve a module path diff --git a/core/gather/gatherers/trace-compat.js b/core/gather/gatherers/trace-compat.js index 3f61aac0ee16..e76298a0f007 100644 --- a/core/gather/gatherers/trace-compat.js +++ b/core/gather/gatherers/trace-compat.js @@ -11,7 +11,7 @@ */ import TraceGatherer from './trace.js'; -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; /** @implements {LH.Gatherer.FRGathererInstance<'Trace'>} */ class TraceCompat extends FRGatherer { diff --git a/core/gather/gatherers/trace-elements.js b/core/gather/gatherers/trace-elements.js index 044247dcc6c2..20ab1a601553 100644 --- a/core/gather/gatherers/trace-elements.js +++ b/core/gather/gatherers/trace-elements.js @@ -12,7 +12,7 @@ * We take the backend nodeId from the trace and use it to find the corresponding element in the DOM. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {resolveNodeIdToObjectId} from '../driver/dom.js'; import {pageFunctions} from '../../lib/page-functions.js'; import * as RectHelpers from '../../lib/rect-helpers.js'; diff --git a/core/gather/gatherers/trace.js b/core/gather/gatherers/trace.js index 563b2cddb4b5..89aa7a904b74 100644 --- a/core/gather/gatherers/trace.js +++ b/core/gather/gatherers/trace.js @@ -10,7 +10,7 @@ * This protocol log can be used to recreate the network records using lib/network-recorder.js. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; import {TraceProcessor} from '../../lib/tracehouse/trace-processor.js'; class Trace extends FRGatherer { diff --git a/core/gather/gatherers/viewport-dimensions.js b/core/gather/gatherers/viewport-dimensions.js index 474ae7f8a3b3..e56d097554fd 100644 --- a/core/gather/gatherers/viewport-dimensions.js +++ b/core/gather/gatherers/viewport-dimensions.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; /* global window */ diff --git a/core/gather/gatherers/web-app-manifest.js b/core/gather/gatherers/web-app-manifest.js index 3f8e3db7dc76..6ada22ecb415 100644 --- a/core/gather/gatherers/web-app-manifest.js +++ b/core/gather/gatherers/web-app-manifest.js @@ -7,7 +7,7 @@ import log from 'lighthouse-logger'; import {parseManifest} from '../../lib/manifest-parser.js'; -import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js'; +import FRGatherer from '../base-gatherer.js'; class WebAppManifest extends FRGatherer { /** @type {LH.Gatherer.GathererMeta} */ diff --git a/core/fraggle-rock/gather/navigation-runner.js b/core/gather/navigation-runner.js similarity index 94% rename from core/fraggle-rock/gather/navigation-runner.js rename to core/gather/navigation-runner.js index a9c838534607..aac82c244ff0 100644 --- a/core/fraggle-rock/gather/navigation-runner.js +++ b/core/gather/navigation-runner.js @@ -8,22 +8,22 @@ import puppeteer from 'puppeteer-core'; import log from 'lighthouse-logger'; import {Driver} from './driver.js'; -import {Runner} from '../../runner.js'; +import {Runner} from '../runner.js'; import {getEmptyArtifactState, collectPhaseArtifacts, awaitArtifacts} from './runner-helpers.js'; -import * as prepare from '../../gather/driver/prepare.js'; -import {gotoURL} from '../../gather/driver/navigation.js'; -import * as storage from '../../gather/driver/storage.js'; -import * as emulation from '../../lib/emulation.js'; -import {defaultNavigationConfig} from '../../config/constants.js'; +import * as prepare from './driver/prepare.js'; +import {gotoURL} from './driver/navigation.js'; +import * as storage from './driver/storage.js'; +import * as emulation from '../lib/emulation.js'; +import {defaultNavigationConfig} from '../config/constants.js'; import {initializeConfig} from '../config/config.js'; import {getBaseArtifacts, finalizeArtifacts} from './base-artifacts.js'; -import * as format from '../../../shared/localization/format.js'; -import {LighthouseError} from '../../lib/lh-error.js'; -import UrlUtils from '../../lib/url-utils.js'; -import {getPageLoadError} from '../../lib/navigation-error.js'; -import Trace from '../../gather/gatherers/trace.js'; -import DevtoolsLog from '../../gather/gatherers/devtools-log.js'; -import {NetworkRecords} from '../../computed/network-records.js'; +import * as format from '../../shared/localization/format.js'; +import {LighthouseError} from '../lib/lh-error.js'; +import UrlUtils from '../lib/url-utils.js'; +import {getPageLoadError} from '../lib/navigation-error.js'; +import Trace from './gatherers/trace.js'; +import DevtoolsLog from './gatherers/devtools-log.js'; +import {NetworkRecords} from '../computed/network-records.js'; /** * @typedef NavigationContext diff --git a/core/fraggle-rock/gather/runner-helpers.js b/core/gather/runner-helpers.js similarity index 100% rename from core/fraggle-rock/gather/runner-helpers.js rename to core/gather/runner-helpers.js diff --git a/core/fraggle-rock/gather/session.js b/core/gather/session.js similarity index 98% rename from core/fraggle-rock/gather/session.js rename to core/gather/session.js index ff4a10d335bf..a8edae23301c 100644 --- a/core/fraggle-rock/gather/session.js +++ b/core/gather/session.js @@ -6,7 +6,7 @@ import EventEmitter from 'events'; -import {LighthouseError} from '../../lib/lh-error.js'; +import {LighthouseError} from '../lib/lh-error.js'; // Controls how long to wait for a response after sending a DevTools protocol command. const DEFAULT_PROTOCOL_TIMEOUT = 30000; diff --git a/core/fraggle-rock/gather/snapshot-runner.js b/core/gather/snapshot-runner.js similarity index 98% rename from core/fraggle-rock/gather/snapshot-runner.js rename to core/gather/snapshot-runner.js index f52bd08741b9..ee1b6c95848d 100644 --- a/core/fraggle-rock/gather/snapshot-runner.js +++ b/core/gather/snapshot-runner.js @@ -7,7 +7,7 @@ import log from 'lighthouse-logger'; import {Driver} from './driver.js'; -import {Runner} from '../../runner.js'; +import {Runner} from '../runner.js'; import {getEmptyArtifactState, collectPhaseArtifacts, awaitArtifacts} from './runner-helpers.js'; import {initializeConfig} from '../config/config.js'; import {getBaseArtifacts, finalizeArtifacts} from './base-artifacts.js'; diff --git a/core/fraggle-rock/gather/timespan-runner.js b/core/gather/timespan-runner.js similarity index 96% rename from core/fraggle-rock/gather/timespan-runner.js rename to core/gather/timespan-runner.js index 462c5b67c026..b22afbe1c6dd 100644 --- a/core/fraggle-rock/gather/timespan-runner.js +++ b/core/gather/timespan-runner.js @@ -7,9 +7,9 @@ import log from 'lighthouse-logger'; import {Driver} from './driver.js'; -import {Runner} from '../../runner.js'; +import {Runner} from '../runner.js'; import {getEmptyArtifactState, collectPhaseArtifacts, awaitArtifacts} from './runner-helpers.js'; -import {prepareTargetForTimespanMode} from '../../gather/driver/prepare.js'; +import {prepareTargetForTimespanMode} from './driver/prepare.js'; import {initializeConfig} from '../config/config.js'; import {getBaseArtifacts, finalizeArtifacts} from './base-artifacts.js'; diff --git a/core/index.js b/core/index.js index fe8b33564b77..c540aa59f5a7 100644 --- a/core/index.js +++ b/core/index.js @@ -10,9 +10,9 @@ import {Runner} from './runner.js'; import {CriConnection} from './legacy/gather/connections/cri.js'; import {Config} from './legacy/config/config.js'; import UrlUtils from './lib/url-utils.js'; -import * as fraggleRock from './fraggle-rock/api.js'; +import * as fraggleRock from './api.js'; import {Driver} from './legacy/gather/driver.js'; -import {initializeConfig} from './fraggle-rock/config/config.js'; +import {initializeConfig} from './config/config.js'; /** @typedef {import('./legacy/gather/connections/connection.js').Connection} Connection */ @@ -109,7 +109,7 @@ const traceCategories = Driver.traceCategories; export default lighthouse; export {Audit} from './audits/audit.js'; -export {default as Gatherer} from './fraggle-rock/gather/base-gatherer.js'; +export {default as Gatherer} from './gather/base-gatherer.js'; export {NetworkRecords} from './computed/network-records.js'; export { legacyNavigation, diff --git a/core/legacy/config/config.js b/core/legacy/config/config.js index 1180b17a66ff..555c1a25e347 100644 --- a/core/legacy/config/config.js +++ b/core/legacy/config/config.js @@ -11,7 +11,7 @@ import log from 'lighthouse-logger'; import legacyDefaultConfig from './legacy-default-config.js'; import * as constants from '../../config/constants.js'; import * as format from '../../../shared/localization/format.js'; -import * as validation from '../../fraggle-rock/config/validation.js'; +import * as validation from '../../config/validation.js'; import {Runner} from '../../runner.js'; import { mergePlugins, diff --git a/core/legacy/gather/gather-runner.js b/core/legacy/gather/gather-runner.js index b0372f2c6cc8..02102ae3919e 100644 --- a/core/legacy/gather/gather-runner.js +++ b/core/legacy/gather/gather-runner.js @@ -20,7 +20,7 @@ import WebAppManifest from '../../gather/gatherers/web-app-manifest.js'; import InstallabilityErrors from '../../gather/gatherers/installability-errors.js'; import NetworkUserAgent from '../../gather/gatherers/network-user-agent.js'; import Stacks from '../../gather/gatherers/stacks.js'; -import {finalizeArtifacts} from '../../fraggle-rock/gather/base-artifacts.js'; +import {finalizeArtifacts} from '../../gather/base-artifacts.js'; import UrlUtils from '../../lib/url-utils.js'; /** @typedef {import('./driver.js').Driver} Driver */ diff --git a/core/scripts/print-a11y-scoring.js b/core/scripts/print-a11y-scoring.js index 26dde9542c35..81f47aecd741 100644 --- a/core/scripts/print-a11y-scoring.js +++ b/core/scripts/print-a11y-scoring.js @@ -6,7 +6,7 @@ // node core/scripts/print-a11y-scoring.js -import {initializeConfig} from '../fraggle-rock/config/config.js'; +import {initializeConfig} from '../config/config.js'; const {config} = await initializeConfig('navigation'); if (!config.categories || !config.audits) throw new Error('wut'); diff --git a/core/scripts/update-flow-fixtures.js b/core/scripts/update-flow-fixtures.js index 13bcf63125d5..db4624032a0e 100644 --- a/core/scripts/update-flow-fixtures.js +++ b/core/scripts/update-flow-fixtures.js @@ -16,7 +16,7 @@ import yargs from 'yargs'; import {getChromePath} from 'chrome-launcher'; import {LH_ROOT} from '../../root.js'; -import * as api from '../fraggle-rock/api.js'; +import * as api from '../api.js'; import * as assetSaver from '../lib/asset-saver.js'; const ARTIFACTS_PATH = diff --git a/core/test/fraggle-rock/config/config-test.js b/core/test/config/config-test.js similarity index 97% rename from core/test/fraggle-rock/config/config-test.js rename to core/test/config/config-test.js index 4ae95389604b..7b52603fe208 100644 --- a/core/test/fraggle-rock/config/config-test.js +++ b/core/test/config/config-test.js @@ -6,13 +6,13 @@ import jestMock from 'jest-mock'; -import {Audit as BaseAudit} from '../../../audits/audit.js'; -import * as constants from '../../../config/constants.js'; -import BaseGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; -import {initializeConfig, getConfigDisplayString} from '../../../fraggle-rock/config/config.js'; -import {LH_ROOT} from '../../../../root.js'; -import * as format from '../../../../shared/localization/format.js'; -import defaultConfig from '../../../config/default-config.js'; +import {Audit as BaseAudit} from '../../audits/audit.js'; +import * as constants from '../../config/constants.js'; +import BaseGatherer from '../../gather/base-gatherer.js'; +import {initializeConfig, getConfigDisplayString} from '../../config/config.js'; +import {LH_ROOT} from '../../../root.js'; +import * as format from '../../../shared/localization/format.js'; +import defaultConfig from '../../config/default-config.js'; const {nonSimulatedPassConfigOverrides} = constants; diff --git a/core/test/fraggle-rock/config/filters-test.js b/core/test/config/filters-test.js similarity index 98% rename from core/test/fraggle-rock/config/filters-test.js rename to core/test/config/filters-test.js index 1626a2385720..0b22bb4a803b 100644 --- a/core/test/fraggle-rock/config/filters-test.js +++ b/core/test/config/filters-test.js @@ -6,11 +6,11 @@ import log from 'lighthouse-logger'; -import {Audit as BaseAudit} from '../../../audits/audit.js'; -import BaseGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; -import {defaultSettings, defaultNavigationConfig} from '../../../config/constants.js'; -import * as filters from '../../../fraggle-rock/config/filters.js'; -import {initializeConfig} from '../../../fraggle-rock/config/config.js'; +import {Audit as BaseAudit} from '../../audits/audit.js'; +import BaseGatherer from '../../gather/base-gatherer.js'; +import {defaultSettings, defaultNavigationConfig} from '../../config/constants.js'; +import * as filters from '../../config/filters.js'; +import {initializeConfig} from '../../config/config.js'; describe('Fraggle Rock Config Filtering', () => { const snapshotGatherer = new BaseGatherer(); diff --git a/core/test/fraggle-rock/config/validation-test.js b/core/test/config/validation-test.js similarity index 96% rename from core/test/fraggle-rock/config/validation-test.js rename to core/test/config/validation-test.js index 61adabc1dd1d..04dc8413bd42 100644 --- a/core/test/fraggle-rock/config/validation-test.js +++ b/core/test/config/validation-test.js @@ -4,12 +4,12 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {defaultSettings, defaultNavigationConfig} from '../../../config/constants.js'; -import defaultConfig from '../../../config/default-config.js'; -import {Audit as BaseAudit} from '../../../audits/audit.js'; -import BaseFRGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; -import {Gatherer as BaseLegacyGatherer} from '../../../gather/gatherers/gatherer.js'; -import * as validation from '../../../fraggle-rock/config/validation.js'; +import {defaultSettings, defaultNavigationConfig} from '../../config/constants.js'; +import defaultConfig from '../../config/default-config.js'; +import {Audit as BaseAudit} from '../../audits/audit.js'; +import BaseFRGatherer from '../../gather/base-gatherer.js'; +import {Gatherer as BaseLegacyGatherer} from '../../gather/gatherers/gatherer.js'; +import * as validation from '../../config/validation.js'; /** @typedef {LH.Gatherer.GathererMeta['supportedModes']} SupportedModes */ diff --git a/core/test/fraggle-rock/gather/base-artifacts-test.js b/core/test/gather/base-artifacts-test.js similarity index 96% rename from core/test/fraggle-rock/gather/base-artifacts-test.js rename to core/test/gather/base-artifacts-test.js index 0f5cdc6cbd22..c58010e3b8cc 100644 --- a/core/test/fraggle-rock/gather/base-artifacts-test.js +++ b/core/test/gather/base-artifacts-test.js @@ -4,10 +4,10 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {getBaseArtifacts, finalizeArtifacts} from '../../../fraggle-rock/gather/base-artifacts.js'; -import {initializeConfig} from '../../../fraggle-rock/config/config.js'; +import {getBaseArtifacts, finalizeArtifacts} from '../../gather/base-artifacts.js'; +import {initializeConfig} from '../../config/config.js'; import {createMockDriver} from './mock-driver.js'; -import {LighthouseError} from '../../../lib/lh-error.js'; +import {LighthouseError} from '../../lib/lh-error.js'; function getMockDriverForArtifacts() { const driverMock = createMockDriver(); diff --git a/core/test/fraggle-rock/gather/base-gatherer-test.js b/core/test/gather/base-gatherer-test.js similarity index 96% rename from core/test/fraggle-rock/gather/base-gatherer-test.js rename to core/test/gather/base-gatherer-test.js index 6856fd53cebf..1d7379af6065 100644 --- a/core/test/fraggle-rock/gather/base-gatherer-test.js +++ b/core/test/gather/base-gatherer-test.js @@ -4,8 +4,8 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import Gatherer from '../../../fraggle-rock/gather/base-gatherer.js'; -import {fnAny} from '../../test-utils.js'; +import Gatherer from '../../gather/base-gatherer.js'; +import {fnAny} from '../test-utils.js'; /** @type {any} */ const fakeParam = {}; diff --git a/core/test/fraggle-rock/gather/driver-test.js b/core/test/gather/driver-test.js similarity index 97% rename from core/test/fraggle-rock/gather/driver-test.js rename to core/test/gather/driver-test.js index be879bd0ce63..c12fafc404f3 100644 --- a/core/test/fraggle-rock/gather/driver-test.js +++ b/core/test/gather/driver-test.js @@ -4,8 +4,8 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {Driver} from '../../../fraggle-rock/gather/driver.js'; -import {fnAny} from '../../test-utils.js'; +import {Driver} from '../../gather/driver.js'; +import {fnAny} from '../test-utils.js'; import {createMockCdpSession} from './mock-driver.js'; /** @type {Array} */ diff --git a/core/test/gather/driver/dom-test.js b/core/test/gather/driver/dom-test.js index b630e4382d30..77e6b6ebb426 100644 --- a/core/test/gather/driver/dom-test.js +++ b/core/test/gather/driver/dom-test.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockSession} from '../mock-driver.js'; import * as dom from '../../../gather/driver/dom.js'; let sessionMock = createMockSession(); diff --git a/core/test/gather/driver/environment-test.js b/core/test/gather/driver/environment-test.js index 5304a36bc29c..9bf10801e4f2 100644 --- a/core/test/gather/driver/environment-test.js +++ b/core/test/gather/driver/environment-test.js @@ -6,7 +6,7 @@ import {defaultSettings} from '../../../config/constants.js'; import * as environment from '../../../gather/driver/environment.js'; -import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockSession} from '../mock-driver.js'; describe('.getBrowserVersion', () => { let sessionMock = createMockSession(); diff --git a/core/test/gather/driver/navigation-test.js b/core/test/gather/driver/navigation-test.js index 9d137daddd05..34428ab50e71 100644 --- a/core/test/gather/driver/navigation-test.js +++ b/core/test/gather/driver/navigation-test.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {createMockDriver} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockDriver} from '../mock-driver.js'; import { mockCommands, makePromiseInspectable, diff --git a/core/test/gather/driver/network-monitor-test.js b/core/test/gather/driver/network-monitor-test.js index 5f52483c55ea..13fd273de963 100644 --- a/core/test/gather/driver/network-monitor-test.js +++ b/core/test/gather/driver/network-monitor-test.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {createMockCdpSession} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockCdpSession} from '../mock-driver.js'; import {NetworkMonitor} from '../../../gather/driver/network-monitor.js'; import {NetworkRequest} from '../../../lib/network-request.js'; import {networkRecordsToDevtoolsLog} from '../../network-records-to-devtools-log.js'; diff --git a/core/test/gather/driver/prepare-test.js b/core/test/gather/driver/prepare-test.js index a83e59e025bd..16a26c6b0818 100644 --- a/core/test/gather/driver/prepare-test.js +++ b/core/test/gather/driver/prepare-test.js @@ -6,7 +6,7 @@ import * as td from 'testdouble'; -import {createMockSession, createMockDriver} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockSession, createMockDriver} from '../mock-driver.js'; import {flushAllTimersAndMicrotasks, fnAny, timers} from '../../test-utils.js'; // import prepare from '../../../gather/driver/prepare.js'; import * as constants from '../../../config/constants.js'; diff --git a/core/test/gather/driver/service-workers-test.js b/core/test/gather/driver/service-workers-test.js index 749bb9305b1a..bb6ae54efc0b 100644 --- a/core/test/gather/driver/service-workers-test.js +++ b/core/test/gather/driver/service-workers-test.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockSession} from '../mock-driver.js'; import {makePromiseInspectable, flushAllTimersAndMicrotasks, timers} from '../../test-utils.js'; import * as serviceWorkers from '../../../gather/driver/service-workers.js'; diff --git a/core/test/gather/driver/storage-test.js b/core/test/gather/driver/storage-test.js index 3b8816e1e149..8d1091e14858 100644 --- a/core/test/gather/driver/storage-test.js +++ b/core/test/gather/driver/storage-test.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockSession} from '../mock-driver.js'; import * as storage from '../../../gather/driver/storage.js'; let sessionMock = createMockSession(); diff --git a/core/test/gather/driver/target-manager-test.js b/core/test/gather/driver/target-manager-test.js index 9d628411607d..d0ac4eced240 100644 --- a/core/test/gather/driver/target-manager-test.js +++ b/core/test/gather/driver/target-manager-test.js @@ -9,7 +9,7 @@ import {EventEmitter} from 'events'; import {CDPSession} from 'puppeteer-core/lib/cjs/puppeteer/common/Connection.js'; import {TargetManager} from '../../../gather/driver/target-manager.js'; -import {createMockCdpSession} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockCdpSession} from '../mock-driver.js'; import {createMockSendCommandFn} from '../../gather/mock-commands.js'; import {fnAny} from '../../test-utils.js'; diff --git a/core/test/gather/gatherers/css-usage-test.js b/core/test/gather/gatherers/css-usage-test.js index a5dddb52b62a..2043b2f5949c 100644 --- a/core/test/gather/gatherers/css-usage-test.js +++ b/core/test/gather/gatherers/css-usage-test.js @@ -6,7 +6,7 @@ import CSSUsage from '../../../gather/gatherers/css-usage.js'; import {defaultSettings} from '../../../config/constants.js'; -import {createMockDriver, createMockBaseArtifacts} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockDriver, createMockBaseArtifacts} from '../mock-driver.js'; import {flushAllTimersAndMicrotasks, timers} from '../../test-utils.js'; timers.useFakeTimers(); diff --git a/core/test/gather/gatherers/dobetterweb/optimized-images-test.js b/core/test/gather/gatherers/dobetterweb/optimized-images-test.js index 7c9ac0e055d2..b3f86f1192eb 100644 --- a/core/test/gather/gatherers/dobetterweb/optimized-images-test.js +++ b/core/test/gather/gatherers/dobetterweb/optimized-images-test.js @@ -5,7 +5,7 @@ */ import OptimizedImages from '../../../../gather/gatherers/dobetterweb/optimized-images.js'; -import {createMockContext} from '../../../fraggle-rock/gather/mock-driver.js'; +import {createMockContext} from '../../../gather/mock-driver.js'; let context = createMockContext(); let optimizedImages; diff --git a/core/test/gather/gatherers/dobetterweb/response-compression-test.js b/core/test/gather/gatherers/dobetterweb/response-compression-test.js index b36b8a2f2c85..ec98c83fd7c1 100644 --- a/core/test/gather/gatherers/dobetterweb/response-compression-test.js +++ b/core/test/gather/gatherers/dobetterweb/response-compression-test.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {createMockContext, mockDriverSubmodules} from '../../../fraggle-rock/gather/mock-driver.js'; +import {createMockContext, mockDriverSubmodules} from '../../../gather/mock-driver.js'; // import ResponseCompression from '../../../../gather/gatherers/dobetterweb/response-compression.js'; // Some imports needs to be done dynamically, so that their dependencies will be mocked. diff --git a/core/test/gather/gatherers/dobetterweb/tags-blocking-first-paint-test.js b/core/test/gather/gatherers/dobetterweb/tags-blocking-first-paint-test.js index dd24d2f3f224..ef17f50872bb 100644 --- a/core/test/gather/gatherers/dobetterweb/tags-blocking-first-paint-test.js +++ b/core/test/gather/gatherers/dobetterweb/tags-blocking-first-paint-test.js @@ -6,7 +6,7 @@ import TagsBlockingFirstPaint from '../../../../gather/gatherers/dobetterweb/tags-blocking-first-paint.js'; -import {createMockContext} from '../../../fraggle-rock/gather/mock-driver.js'; +import {createMockContext} from '../../../gather/mock-driver.js'; let tagsBlockingFirstPaint; const traceData = { diff --git a/core/test/gather/gatherers/full-page-screenshot-test.js b/core/test/gather/gatherers/full-page-screenshot-test.js index 3899f4a41c3f..53f127f4720d 100644 --- a/core/test/gather/gatherers/full-page-screenshot-test.js +++ b/core/test/gather/gatherers/full-page-screenshot-test.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {createMockContext} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockContext} from '../../gather/mock-driver.js'; import FullPageScreenshotGatherer from '../../../gather/gatherers/full-page-screenshot.js'; // Headless's default value is (1024 * 16), but this varies by device diff --git a/core/test/gather/gatherers/image-elements-test.js b/core/test/gather/gatherers/image-elements-test.js index cd7a160d120d..0c1d1f0871c8 100644 --- a/core/test/gather/gatherers/image-elements-test.js +++ b/core/test/gather/gatherers/image-elements-test.js @@ -9,7 +9,7 @@ import jestMock from 'jest-mock'; import ImageElements from '../../../gather/gatherers/image-elements.js'; import {NetworkRecorder} from '../../../lib/network-recorder.js'; import {createMockContext, createMockDriver, createMockSession} from - '../../fraggle-rock/gather/mock-driver.js'; + '../mock-driver.js'; import {fnAny, readJson, timers} from '../../test-utils.js'; const devtoolsLog = readJson('../../fixtures/traces/lcp-m78.devtools.log.json', import.meta); diff --git a/core/test/gather/gatherers/inspector-issues-test.js b/core/test/gather/gatherers/inspector-issues-test.js index c48216090d49..a64656196565 100644 --- a/core/test/gather/gatherers/inspector-issues-test.js +++ b/core/test/gather/gatherers/inspector-issues-test.js @@ -6,7 +6,7 @@ import InspectorIssues from '../../../gather/gatherers/inspector-issues.js'; import {NetworkRequest} from '../../../lib/network-request.js'; -import {createMockContext} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockContext} from '../mock-driver.js'; import {flushAllTimersAndMicrotasks, timers} from '../../test-utils.js'; import {networkRecordsToDevtoolsLog} from '../../network-records-to-devtools-log.js'; diff --git a/core/test/gather/gatherers/installability-errors-test.js b/core/test/gather/gatherers/installability-errors-test.js index 8cfaafdcf6b3..6fdcc212c0cf 100644 --- a/core/test/gather/gatherers/installability-errors-test.js +++ b/core/test/gather/gatherers/installability-errors-test.js @@ -5,7 +5,7 @@ */ import InstallabilityErrors from '../../../gather/gatherers/installability-errors.js'; -import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockSession} from '../mock-driver.js'; describe('.getInstallabilityErrors', () => { let session = createMockSession(); diff --git a/core/test/gather/gatherers/js-usage-test.js b/core/test/gather/gatherers/js-usage-test.js index 29b3393bcc06..e34d7cbb6a05 100644 --- a/core/test/gather/gatherers/js-usage-test.js +++ b/core/test/gather/gatherers/js-usage-test.js @@ -8,7 +8,7 @@ import {Driver} from '../../../legacy/gather/driver.js'; import {Connection} from '../../../legacy/gather/connections/connection.js'; import JsUsage from '../../../gather/gatherers/js-usage.js'; import {createMockSendCommandFn, createMockOnFn} from '../mock-commands.js'; -import {createMockContext} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockContext} from '../../gather/mock-driver.js'; import {flushAllTimersAndMicrotasks, timers} from '../../test-utils.js'; timers.useFakeTimers(); diff --git a/core/test/gather/gatherers/main-document-content-test.js b/core/test/gather/gatherers/main-document-content-test.js index b65814978512..df04c20972e5 100644 --- a/core/test/gather/gatherers/main-document-content-test.js +++ b/core/test/gather/gatherers/main-document-content-test.js @@ -6,7 +6,7 @@ import MainDocumentContent from '../../../gather/gatherers/main-document-content.js'; import {NetworkRecorder} from '../../../lib/network-recorder.js'; -import {createMockContext} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockContext} from '../mock-driver.js'; import {getURLArtifactFromDevtoolsLog, readJson} from '../../test-utils.js'; const devtoolsLog = readJson('../../fixtures/traces/lcp-m78.devtools.log.json', import.meta); diff --git a/core/test/gather/gatherers/script-elements-test.js b/core/test/gather/gatherers/script-elements-test.js index 324b51f6f23a..cbc1cbb595a5 100644 --- a/core/test/gather/gatherers/script-elements-test.js +++ b/core/test/gather/gatherers/script-elements-test.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {createMockContext, mockDriverSubmodules} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockContext, mockDriverSubmodules} from '../mock-driver.js'; // import ScriptElements from '../../../gather/gatherers/script-elements.js'; import {NetworkRequest} from '../../../lib/network-request.js'; diff --git a/core/test/gather/gatherers/trace-test.js b/core/test/gather/gatherers/trace-test.js index 54b1b0b6ef2d..f5d4b9e09976 100644 --- a/core/test/gather/gatherers/trace-test.js +++ b/core/test/gather/gatherers/trace-test.js @@ -5,7 +5,7 @@ */ import {makePromiseInspectable, flushAllTimersAndMicrotasks, timers} from '../../test-utils.js'; -import {createMockContext} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockContext} from '../mock-driver.js'; import TraceGatherer from '../../../gather/gatherers/trace.js'; timers.useFakeTimers(); diff --git a/core/test/gather/gatherers/web-app-manifest-test.js b/core/test/gather/gatherers/web-app-manifest-test.js index 53cbcb241a21..47843e72346a 100644 --- a/core/test/gather/gatherers/web-app-manifest-test.js +++ b/core/test/gather/gatherers/web-app-manifest-test.js @@ -8,7 +8,7 @@ import fs from 'fs'; import {LH_ROOT} from '../../../../root.js'; import WebAppManifest from '../../../gather/gatherers/web-app-manifest.js'; -import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockSession} from '../mock-driver.js'; describe('WebAppManifest Gatherer', () => { let session = createMockSession(); diff --git a/core/test/fraggle-rock/gather/mock-driver.js b/core/test/gather/mock-driver.js similarity index 90% rename from core/test/fraggle-rock/gather/mock-driver.js rename to core/test/gather/mock-driver.js index 6bcc2cd1cab0..8d9d340aaf3b 100644 --- a/core/test/fraggle-rock/gather/mock-driver.js +++ b/core/test/gather/mock-driver.js @@ -15,13 +15,13 @@ import { createMockOnFn, createMockOnceFn, createMockSendCommandFn, -} from '../../gather/mock-commands.js'; -import * as constants from '../../../config/constants.js'; -import {fnAny} from '../../test-utils.js'; -import {LH_ROOT} from '../../../../root.js'; +} from './mock-commands.js'; +import * as constants from '../../config/constants.js'; +import {fnAny} from '../test-utils.js'; +import {LH_ROOT} from '../../../root.js'; -/** @typedef {import('../../../fraggle-rock/gather/driver.js').Driver} Driver */ -/** @typedef {import('../../../gather/driver/execution-context.js')} ExecutionContext */ +/** @typedef {import('../../gather/driver.js').Driver} Driver */ +/** @typedef {import('../../gather/driver/execution-context.js')} ExecutionContext */ function createMockSession() { return { @@ -141,7 +141,7 @@ function createMockTargetManager(session) { on: createMockOnFn(), off: fnAny(), - /** @return {import('../../../gather/driver/target-manager.js')} */ + /** @return {import('../../gather/driver/target-manager.js')} */ asTargetManager() { // @ts-expect-error - We'll rely on the tests passing to know this matches. return this; @@ -290,11 +290,11 @@ async function mockDriverSubmodules() { return (...args) => target[name](...args); }; - await td.replaceEsm('../../../gather/driver/navigation.js', new Proxy(navigationMock, {get})); - await td.replaceEsm('../../../gather/driver/prepare.js', new Proxy(prepareMock, {get})); - await td.replaceEsm('../../../gather/driver/storage.js', new Proxy(storageMock, {get})); - await td.replaceEsm('../../../gather/driver/network.js', new Proxy(networkMock, {get})); - await td.replaceEsm('../../../lib/emulation.js', new Proxy(emulationMock, {get})); + await td.replaceEsm('../../gather/driver/navigation.js', new Proxy(navigationMock, {get})); + await td.replaceEsm('../../gather/driver/prepare.js', new Proxy(prepareMock, {get})); + await td.replaceEsm('../../gather/driver/storage.js', new Proxy(storageMock, {get})); + await td.replaceEsm('../../gather/driver/network.js', new Proxy(networkMock, {get})); + await td.replaceEsm('../../lib/emulation.js', new Proxy(emulationMock, {get})); reset(); diff --git a/core/test/fraggle-rock/gather/navigation-runner-test.js b/core/test/gather/navigation-runner-test.js similarity index 96% rename from core/test/fraggle-rock/gather/navigation-runner-test.js rename to core/test/gather/navigation-runner-test.js index f9e6f7ddf3f8..f3ee6dc215e6 100644 --- a/core/test/fraggle-rock/gather/navigation-runner-test.js +++ b/core/test/gather/navigation-runner-test.js @@ -12,19 +12,19 @@ import { mockDriverSubmodules, mockRunnerModule, } from './mock-driver.js'; -import {initializeConfig} from '../../../fraggle-rock/config/config.js'; -import {defaultNavigationConfig} from '../../../config/constants.js'; -import {LighthouseError} from '../../../lib/lh-error.js'; -import DevtoolsLogGatherer from '../../../gather/gatherers/devtools-log.js'; -import TraceGatherer from '../../../gather/gatherers/trace.js'; -import {fnAny} from '../../test-utils.js'; -import {networkRecordsToDevtoolsLog} from '../../network-records-to-devtools-log.js'; -import {Runner as runnerActual} from '../../../runner.js'; +import {initializeConfig} from '../../config/config.js'; +import {defaultNavigationConfig} from '../../config/constants.js'; +import {LighthouseError} from '../../lib/lh-error.js'; +import DevtoolsLogGatherer from '../../gather/gatherers/devtools-log.js'; +import TraceGatherer from '../../gather/gatherers/trace.js'; +import {fnAny} from '../test-utils.js'; +import {networkRecordsToDevtoolsLog} from '../network-records-to-devtools-log.js'; +import {Runner as runnerActual} from '../../runner.js'; // Some imports needs to be done dynamically, so that their dependencies will be mocked. // See: https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs // https://github.com/facebook/jest/issues/10025 -/** @type {import('../../../fraggle-rock/gather/navigation-runner.js')} */ +/** @type {import('../../gather/navigation-runner.js')} */ let runner; const mocks = await mockDriverSubmodules(); @@ -33,7 +33,7 @@ beforeEach(async () => { mockRunner.reset(); mockRunner.getGathererList.mockImplementation(runnerActual.getGathererList); mockRunner.getAuditList.mockImplementation(runnerActual.getAuditList); - runner = (await import('../../../fraggle-rock/gather/navigation-runner.js')); + runner = (await import('../../gather/navigation-runner.js')); }); /** @typedef {{meta: LH.Gatherer.GathererMeta<'Accessibility'>, getArtifact: Mock, startInstrumentation: Mock, stopInstrumentation: Mock, startSensitiveInstrumentation: Mock, stopSensitiveInstrumentation: Mock}} MockGatherer */ @@ -44,7 +44,7 @@ describe('NavigationRunner', () => { let requestor; /** @type {ReturnType} */ let mockDriver; - /** @type {import('../../../fraggle-rock/gather/driver.js').Driver} */ + /** @type {import('../../gather/driver.js').Driver} */ let driver; /** @type {LH.Puppeteer.Page} */ let page; diff --git a/core/test/fraggle-rock/gather/runner-helpers-test.js b/core/test/gather/runner-helpers-test.js similarity index 96% rename from core/test/fraggle-rock/gather/runner-helpers-test.js rename to core/test/gather/runner-helpers-test.js index 7c71d34f8f2b..8b0e087986e9 100644 --- a/core/test/fraggle-rock/gather/runner-helpers-test.js +++ b/core/test/gather/runner-helpers-test.js @@ -4,9 +4,9 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import * as helpers from '../../../fraggle-rock/gather/runner-helpers.js'; -import Gatherer from '../../../fraggle-rock/gather/base-gatherer.js'; -import {defaultSettings} from '../../../config/constants.js'; +import * as helpers from '../../gather/runner-helpers.js'; +import Gatherer from '../../gather/base-gatherer.js'; +import {defaultSettings} from '../../config/constants.js'; import {createMockDriver, createMockGathererInstance, createMockBaseArtifacts} from './mock-driver.js'; // eslint-disable-line max-len describe('collectArtifactDependencies', () => { @@ -76,7 +76,7 @@ describe('collectArtifactDependencies', () => { }); describe('collectPhaseArtifacts', () => { - /** @type {import('../../../fraggle-rock/gather/runner-helpers').ArtifactState} */ + /** @type {import('../../gather/runner-helpers').ArtifactState} */ let artifactState = { startInstrumentation: {}, startSensitiveInstrumentation: {}, diff --git a/core/test/fraggle-rock/gather/session-test.js b/core/test/gather/session-test.js similarity index 98% rename from core/test/fraggle-rock/gather/session-test.js rename to core/test/gather/session-test.js index 72cbac64ec8d..f554e5b7c3ec 100644 --- a/core/test/fraggle-rock/gather/session-test.js +++ b/core/test/gather/session-test.js @@ -8,14 +8,14 @@ import {EventEmitter} from 'events'; import {CDPSession} from 'puppeteer/lib/cjs/puppeteer/common/Connection.js'; -import {ProtocolSession} from '../../../fraggle-rock/gather/session.js'; +import {ProtocolSession} from '../../gather/session.js'; import { flushAllTimersAndMicrotasks, makePromiseInspectable, createDecomposedPromise, fnAny, timers, -} from '../../test-utils.js'; +} from '../test-utils.js'; timers.useFakeTimers(); diff --git a/core/test/fraggle-rock/gather/snapshot-runner-test.js b/core/test/gather/snapshot-runner-test.js similarity index 94% rename from core/test/fraggle-rock/gather/snapshot-runner-test.js rename to core/test/gather/snapshot-runner-test.js index 3e8cae57ae13..c17dc1f45ed2 100644 --- a/core/test/fraggle-rock/gather/snapshot-runner-test.js +++ b/core/test/gather/snapshot-runner-test.js @@ -4,7 +4,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// import {snapshotGather} from '../../../fraggle-rock/gather/snapshot-runner.js'; +// import {snapshotGather} from '../../../gather/snapshot-runner.js'; import * as td from 'testdouble'; import { @@ -18,11 +18,11 @@ import { // Some imports needs to be done dynamically, so that their dependencies will be mocked. // See: https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs // https://github.com/facebook/jest/issues/10025 -/** @type {import('../../../fraggle-rock/gather/snapshot-runner.js')['snapshotGather']} */ +/** @type {import('../../gather/snapshot-runner.js')['snapshotGather']} */ let snapshotGather; before(async () => { - snapshotGather = (await import('../../../fraggle-rock/gather/snapshot-runner.js')).snapshotGather; + snapshotGather = (await import('../../gather/snapshot-runner.js')).snapshotGather; }); const mockRunner = await mockRunnerModule(); @@ -31,7 +31,7 @@ const mockRunner = await mockRunnerModule(); /** @type {ReturnType} */ let mockDriver; -await td.replaceEsm('../../../fraggle-rock/gather/driver.js', +await td.replaceEsm('../../gather/driver.js', mockDriverModule(() => mockDriver.asDriver())); describe('Snapshot Runner', () => { diff --git a/core/test/fraggle-rock/gather/timespan-runner-test.js b/core/test/gather/timespan-runner-test.js similarity index 95% rename from core/test/fraggle-rock/gather/timespan-runner-test.js rename to core/test/gather/timespan-runner-test.js index 6f3ae4beb27a..544a85964b14 100644 --- a/core/test/fraggle-rock/gather/timespan-runner-test.js +++ b/core/test/gather/timespan-runner-test.js @@ -6,7 +6,7 @@ import * as td from 'testdouble'; -// import {startTimespanGather} from '../../../fraggle-rock/gather/timespan-runner.js'; +// import {startTimespanGather} from '../../../gather/timespan-runner.js'; import { createMockDriver, createMockPage, @@ -19,12 +19,12 @@ import { // Some imports needs to be done dynamically, so that their dependencies will be mocked. // See: https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs // https://github.com/facebook/jest/issues/10025 -/** @type {import('../../../fraggle-rock/gather/timespan-runner.js')['startTimespanGather']} */ +/** @type {import('../../gather/timespan-runner.js')['startTimespanGather']} */ let startTimespanGather; before(async () => { startTimespanGather = - (await import('../../../fraggle-rock/gather/timespan-runner.js')).startTimespanGather; + (await import('../../gather/timespan-runner.js')).startTimespanGather; }); const mockSubmodules = await mockDriverSubmodules(); @@ -33,7 +33,7 @@ const mockRunner = await mockRunnerModule(); // Establish the mocks before we import the file under test. /** @type {ReturnType} */ let mockDriver; -await td.replaceEsm('../../../fraggle-rock/gather/driver.js', +await td.replaceEsm('../../gather/driver.js', mockDriverModule(() => mockDriver.asDriver())); describe('Timespan Runner', () => { diff --git a/core/test/lib/stack-packs-test.js b/core/test/lib/stack-packs-test.js index 999f9b740e4d..a2f75d5e9b56 100644 --- a/core/test/lib/stack-packs-test.js +++ b/core/test/lib/stack-packs-test.js @@ -6,7 +6,7 @@ import lighthouseStackPacksDep from 'lighthouse-stack-packs'; -import {initializeConfig} from '../../fraggle-rock/config/config.js'; +import {initializeConfig} from '../../config/config.js'; import {stackPacksToInclude} from '../../lib/stack-packs.js'; async function getAuditIds() { diff --git a/core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap b/core/test/scenarios/__snapshots__/api-test-pptr.js.snap similarity index 100% rename from core/test/fraggle-rock/scenarios/__snapshots__/api-test-pptr.js.snap rename to core/test/scenarios/__snapshots__/api-test-pptr.js.snap diff --git a/core/test/fraggle-rock/scenarios/api-test-pptr.js b/core/test/scenarios/api-test-pptr.js similarity index 98% rename from core/test/fraggle-rock/scenarios/api-test-pptr.js rename to core/test/scenarios/api-test-pptr.js index b50bf5c7ff6d..d2c9f4ee49d0 100644 --- a/core/test/fraggle-rock/scenarios/api-test-pptr.js +++ b/core/test/scenarios/api-test-pptr.js @@ -6,9 +6,9 @@ import jestMock from 'jest-mock'; -import * as lighthouse from '../../../fraggle-rock/api.js'; +import * as lighthouse from '../../api.js'; import {createTestState, getAuditsBreakdown} from './pptr-test-utils.js'; -import {LH_ROOT} from '../../../../root.js'; +import {LH_ROOT} from '../../../root.js'; describe('Fraggle Rock API', function() { // eslint-disable-next-line no-invalid-this diff --git a/core/test/fraggle-rock/scenarios/cross-origin-test-pptr.js b/core/test/scenarios/cross-origin-test-pptr.js similarity index 93% rename from core/test/fraggle-rock/scenarios/cross-origin-test-pptr.js rename to core/test/scenarios/cross-origin-test-pptr.js index 10e1c7e03f84..b064f9aa7024 100644 --- a/core/test/fraggle-rock/scenarios/cross-origin-test-pptr.js +++ b/core/test/scenarios/cross-origin-test-pptr.js @@ -4,9 +4,9 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import * as lighthouse from '../../../fraggle-rock/api.js'; +import * as lighthouse from '../../api.js'; import {createTestState} from './pptr-test-utils.js'; -import {LH_ROOT} from '../../../../root.js'; +import {LH_ROOT} from '../../../root.js'; /* eslint-env browser */ diff --git a/core/test/fraggle-rock/scenarios/disconnect-test-pptr.js b/core/test/scenarios/disconnect-test-pptr.js similarity index 96% rename from core/test/fraggle-rock/scenarios/disconnect-test-pptr.js rename to core/test/scenarios/disconnect-test-pptr.js index ba80de9198ba..7080b63c324a 100644 --- a/core/test/fraggle-rock/scenarios/disconnect-test-pptr.js +++ b/core/test/scenarios/disconnect-test-pptr.js @@ -6,9 +6,9 @@ /* eslint-env browser */ -import * as lighthouse from '../../../fraggle-rock/api.js'; +import * as lighthouse from '../../api.js'; import {createTestState} from './pptr-test-utils.js'; -import {LH_ROOT} from '../../../../root.js'; +import {LH_ROOT} from '../../../root.js'; describe('Disconnect', function() { // eslint-disable-next-line no-invalid-this diff --git a/core/test/fraggle-rock/scenarios/pptr-test-utils.js b/core/test/scenarios/pptr-test-utils.js similarity index 95% rename from core/test/fraggle-rock/scenarios/pptr-test-utils.js rename to core/test/scenarios/pptr-test-utils.js index d04a4bc4f70e..04b8bb836b6d 100644 --- a/core/test/fraggle-rock/scenarios/pptr-test-utils.js +++ b/core/test/scenarios/pptr-test-utils.js @@ -8,9 +8,9 @@ import {before, beforeEach, after, afterEach} from 'mocha'; import puppeteer from 'puppeteer-core'; import {getChromePath} from 'chrome-launcher'; -import {Server} from '../../../../cli/test/fixtures/static-server.js'; +import {Server} from '../../../cli/test/fixtures/static-server.js'; -/** @typedef {InstanceType} StaticServer */ +/** @typedef {InstanceType} StaticServer */ /** * Some audits can be notApplicable based on machine timing information. diff --git a/core/test/fraggle-rock/scenarios/start-end-navigation-test-pptr.js b/core/test/scenarios/start-end-navigation-test-pptr.js similarity index 95% rename from core/test/fraggle-rock/scenarios/start-end-navigation-test-pptr.js rename to core/test/scenarios/start-end-navigation-test-pptr.js index b7ffd33f5d0e..3d7ec1fb0d4a 100644 --- a/core/test/fraggle-rock/scenarios/start-end-navigation-test-pptr.js +++ b/core/test/scenarios/start-end-navigation-test-pptr.js @@ -4,9 +4,9 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import * as lighthouse from '../../../fraggle-rock/api.js'; +import * as lighthouse from '../../api.js'; import {createTestState, getAuditsBreakdown} from './pptr-test-utils.js'; -import {LH_ROOT} from '../../../../root.js'; +import {LH_ROOT} from '../../../root.js'; /* eslint-env browser */ diff --git a/core/test/scripts/run-mocha-tests.js b/core/test/scripts/run-mocha-tests.js index 845558706708..5ab281bdb15c 100644 --- a/core/test/scripts/run-mocha-tests.js +++ b/core/test/scripts/run-mocha-tests.js @@ -65,7 +65,7 @@ function getFailedTests() { const testsToIsolate = new Set([ // grep -lRE '^timers\.useFakeTimers' --include='*-test.*' --exclude-dir=node_modules 'flow-report/test/common-test.tsx', - 'core/test/fraggle-rock/gather/session-test.js', + 'core/test/gather/session-test.js', 'core/test/legacy/gather/driver-test.js', 'core/test/gather/driver/execution-context-test.js', 'core/test/gather/driver/navigation-test.js', @@ -79,28 +79,28 @@ const testsToIsolate = new Set([ 'core/test/gather/gatherers/trace-test.js', // grep -lRE '^await td\.replace' --include='*-test.*' --exclude-dir=node_modules - 'core/test/fraggle-rock/gather/snapshot-runner-test.js', - 'core/test/fraggle-rock/gather/timespan-runner-test.js', - 'core/test/fraggle-rock/user-flow-test.js', + 'core/test/gather/snapshot-runner-test.js', + 'core/test/gather/timespan-runner-test.js', + 'core/test/user-flow-test.js', 'core/test/gather/driver/prepare-test.js', 'core/test/gather/gatherers/link-elements-test.js', 'core/test/gather/gatherers/service-worker-test.js', 'core/test/runner-test.js', // grep -lRE --include='-test.js' 'mockDriverSubmodules|mockRunnerModule|mockDriverModule|mockDriverSubmodules|makeMocksForGatherRunner' --include='*-test.*' --exclude-dir=node_modules - 'core/test/fraggle-rock/gather/navigation-runner-test.js', - 'core/test/fraggle-rock/gather/snapshot-runner-test.js', - 'core/test/fraggle-rock/gather/timespan-runner-test.js', - 'core/test/fraggle-rock/user-flow-test.js', + 'core/test/gather/navigation-runner-test.js', + 'core/test/gather/snapshot-runner-test.js', + 'core/test/gather/timespan-runner-test.js', + 'core/test/user-flow-test.js', 'core/test/legacy/gather/gather-runner-test.js', 'core/test/gather/gatherers/dobetterweb/response-compression-test.js', 'core/test/gather/gatherers/script-elements-test.js', 'core/test/runner-test.js', // These tend to timeout in puppeteer when run in parallel with other tests. - 'core/test/fraggle-rock/scenarios/api-test-pptr.js', - 'core/test/fraggle-rock/scenarios/cross-origin-test-pptr.js', - 'core/test/fraggle-rock/scenarios/disconnect-test-pptr.js', + 'core/test/scenarios/api-test-pptr.js', + 'core/test/scenarios/cross-origin-test-pptr.js', + 'core/test/scenarios/disconnect-test-pptr.js', // ? 'clients/test/lightrider/lightrider-entry-test.js', // Runner overrides. @@ -108,7 +108,7 @@ const testsToIsolate = new Set([ 'cli/test/cli/bin-test.js', 'cli/test/cli/run-test.js', 'core/test/legacy/config/config-test.js', - 'core/test/fraggle-rock/config/config-test.js', + 'core/test/config/config-test.js', 'core/test/lib/emulation-test.js', 'core/test/lib/sentry-test.js', 'report/test/clients/bundle-test.js', @@ -180,7 +180,7 @@ const defaultTestMatches = [ 'clients/test/**/*-test.js', 'cli/**/*-test.js', 'core/**/*-test.js', - 'core/test/fraggle-rock/**/*-test-pptr.js', + 'core/test/**/*-test-pptr.js', 'report/**/*-test.js', 'shared/**/*-test.js', 'third-party/**/*-test.js', diff --git a/core/test/fraggle-rock/user-flow-test.js b/core/test/user-flow-test.js similarity index 96% rename from core/test/fraggle-rock/user-flow-test.js rename to core/test/user-flow-test.js index c51b2c4e7ce7..2d8f637f9388 100644 --- a/core/test/fraggle-rock/user-flow-test.js +++ b/core/test/user-flow-test.js @@ -7,28 +7,28 @@ import jestMock from 'jest-mock'; import * as td from 'testdouble'; -import {Runner} from '../../runner.js'; +import {Runner} from '../runner.js'; import {createMockPage, mockRunnerModule} from './gather/mock-driver.js'; -// import UserFlow from '../../fraggle-rock/user-flow.js'; +// import UserFlow from '../../user-flow.js'; // Some imports needs to be done dynamically, so that their dependencies will be mocked. // See: https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs // https://github.com/facebook/jest/issues/10025 -/** @type {typeof import('../../fraggle-rock/user-flow.js').UserFlow} */ +/** @type {typeof import('../user-flow.js').UserFlow} */ let UserFlow; -/** @type {typeof import('../../fraggle-rock/user-flow.js')['auditGatherSteps']} */ +/** @type {typeof import('../user-flow.js')['auditGatherSteps']} */ let auditGatherSteps; before(async () => { - ({UserFlow, auditGatherSteps} = await import('../../fraggle-rock/user-flow.js')); + ({UserFlow, auditGatherSteps} = await import('../user-flow.js')); }); const snapshotModule = {snapshotGather: jestMock.fn()}; -await td.replaceEsm('../../fraggle-rock/gather/snapshot-runner.js', snapshotModule); +await td.replaceEsm('../gather/snapshot-runner.js', snapshotModule); const navigationModule = {navigationGather: jestMock.fn()}; -await td.replaceEsm('../../fraggle-rock/gather/navigation-runner.js', navigationModule); +await td.replaceEsm('../gather/navigation-runner.js', navigationModule); const timespanModule = {startTimespanGather: jestMock.fn()}; -await td.replaceEsm('../../fraggle-rock/gather/timespan-runner.js', timespanModule); +await td.replaceEsm('../gather/timespan-runner.js', timespanModule); const mockRunner = await mockRunnerModule(); diff --git a/core/fraggle-rock/user-flow.js b/core/user-flow.js similarity index 98% rename from core/fraggle-rock/user-flow.js rename to core/user-flow.js index 8d5576e43541..d2af374d85e1 100644 --- a/core/fraggle-rock/user-flow.js +++ b/core/user-flow.js @@ -4,11 +4,11 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {ReportGenerator} from '../../report/generator/report-generator.js'; +import {ReportGenerator} from '../report/generator/report-generator.js'; import {snapshotGather} from './gather/snapshot-runner.js'; import {startTimespanGather} from './gather/timespan-runner.js'; import {navigationGather} from './gather/navigation-runner.js'; -import {Runner} from '../runner.js'; +import {Runner} from './runner.js'; import {initializeConfig} from './config/config.js'; /** @typedef {Parameters[0]} FrOptions */ diff --git a/docs/user-flows.md b/docs/user-flows.md index a673bdaf0887..fce5c350f67d 100644 --- a/docs/user-flows.md +++ b/docs/user-flows.md @@ -40,7 +40,7 @@ In DevTools, navigation is easy: ensure it's the selected mode and then click _A ```js import {writeFileSync} from 'fs'; import puppeteer from 'puppeteer'; -import lighthouse from 'lighthouse/core/fraggle-rock/api.js'; +import lighthouse from 'lighthouse/core/api.js'; (async function() { const browser = await puppeteer.launch(); @@ -90,7 +90,7 @@ In DevTools, select "Timespan" as the mode and click _Start timespan_. Record wh ```js import {writeFileSync} from 'fs'; import puppeteer from 'puppeteer'; -import lighthouse from 'lighthouse/core/fraggle-rock/api.js'; +import lighthouse from 'lighthouse/core/api.js'; (async function() { const browser = await puppeteer.launch(); @@ -125,7 +125,7 @@ In DevTools, select "Snapshot" as the mode. Set up the page in the state you wan ```js import {writeFileSync} from 'fs'; import puppeteer from 'puppeteer'; -import lighthouse from 'lighthouse/core/fraggle-rock/api.js'; +import lighthouse from 'lighthouse/core/api.js'; (async function() { const browser = await puppeteer.launch(); @@ -164,7 +164,7 @@ The below example codifies a user flow for an ecommerce site where the user navi import {writeFileSync} from 'fs'; import puppeteer from 'puppeteer'; import * as pptrTestingLibrary from 'pptr-testing-library'; -import lighthouse from 'lighthouse/core/fraggle-rock/api.js'; +import lighthouse from 'lighthouse/core/api.js'; const {getDocument, queries} = pptrTestingLibrary; diff --git a/types/user-flow.d.ts b/types/user-flow.d.ts index c1bc68133423..ceb42175faad 100644 --- a/types/user-flow.d.ts +++ b/types/user-flow.d.ts @@ -1,4 +1,4 @@ -import {UserFlow as UserFlow_} from '../core/fraggle-rock/user-flow'; +import {UserFlow as UserFlow_} from '../core/user-flow'; declare module UserFlow { export interface FlowArtifacts {