From e49360527915f70afef2e10ec3d95419beda125d Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Tue, 3 May 2022 17:26:35 -0700 Subject: [PATCH 1/4] tests(eslint): add import/order rule for core tests --- lighthouse-core/test/.eslintrc.cjs | 28 +++++++++++++++++++ .../accessibility/aria-allowed-attr-test.js | 5 ++-- .../accessibility/aria-required-attr-test.js | 5 ++-- .../aria-required-children-test.js | 5 ++-- .../aria-required-parent-test.js | 5 ++-- .../audits/accessibility/aria-roles-test.js | 5 ++-- .../accessibility/aria-valid-attr-test.js | 5 ++-- .../aria-valid-attr-value-test.js | 5 ++-- .../audits/accessibility/axe-audit-test.js | 6 ++-- .../audits/accessibility/button-name-test.js | 5 ++-- .../test/audits/accessibility/bypass-test.js | 5 ++-- .../accessibility/color-contrast-test.js | 5 ++-- .../accessibility/definition-list-test.js | 5 ++-- .../test/audits/accessibility/dlitem-test.js | 5 ++-- .../accessibility/document-title-test.js | 5 ++-- .../audits/accessibility/frame-title-test.js | 5 ++-- .../accessibility/html-has-lang-test.js | 5 ++-- .../accessibility/html-lang-valid-test.js | 5 ++-- .../audits/accessibility/image-alt-test.js | 5 ++-- .../accessibility/input-image-alt-test.js | 5 ++-- .../test/audits/accessibility/label-test.js | 5 ++-- .../audits/accessibility/link-name-test.js | 5 ++-- .../test/audits/accessibility/list-test.js | 5 ++-- .../audits/accessibility/listitem-test.js | 5 ++-- .../audits/accessibility/meta-refresh-test.js | 5 ++-- .../accessibility/meta-viewport-test.js | 5 ++-- .../audits/accessibility/object-alt-test.js | 5 ++-- .../audits/accessibility/tabindex-test.js | 5 ++-- .../accessibility/td-headers-attr-test.js | 5 ++-- .../accessibility/th-has-data-cells-test.js | 5 ++-- .../audits/accessibility/valid-lang-test.js | 5 ++-- .../accessibility/video-caption-test.js | 5 ++-- .../test/audits/apple-touch-icon-test.js | 2 +- lighthouse-core/test/audits/audit-test.js | 5 ++-- .../test/audits/autocomplete-test.js | 2 +- .../test/audits/bootup-time-test.js | 6 ++-- .../byte-efficiency-audit-test.js | 5 ++-- .../duplicated-javascript-test.js | 3 +- .../efficient-animated-content-test.js | 6 ++-- .../byte-efficiency/legacy-javascript-test.js | 2 +- .../modern-image-formats-test.js | 2 +- .../byte-efficiency/offscreen-images-test.js | 5 ++-- .../render-blocking-resources-test.js | 5 ++-- .../byte-efficiency/total-byte-weight-test.js | 3 +- .../byte-efficiency/unminified-css-test.js | 5 ++-- .../unminified-javascript-test.js | 5 ++-- .../byte-efficiency/unused-css-rules-test.js | 5 ++-- .../byte-efficiency/unused-javascript-test.js | 3 +- .../uses-long-cache-ttl-test.js | 5 ++-- .../uses-optimized-images-test.js | 2 +- .../uses-responsive-images-snapshot-test.js | 2 +- .../uses-responsive-images-test.js | 5 ++-- .../uses-text-compression-test.js | 5 ++-- .../test/audits/content-width-test.js | 5 ++-- .../audits/critical-request-chains-test.js | 6 ++-- lighthouse-core/test/audits/csp-xss-test.js | 5 ++-- .../test/audits/deprecations-test.js | 5 ++-- .../test/audits/diagnostics-test.js | 2 +- .../test/audits/dobetterweb/charset-test.js | 5 ++-- .../test/audits/dobetterweb/doctype-test.js | 5 ++-- .../test/audits/dobetterweb/dom-size-test.js | 5 ++-- .../dobetterweb/geolocation-on-start-test.js | 5 ++-- .../dobetterweb/inspector-issues-test.js | 2 +- .../audits/dobetterweb/js-libraries-test.js | 5 ++-- .../dobetterweb/no-document-write-test.js | 5 ++-- .../no-vulnerable-libraries-test.js | 6 ++-- .../dobetterweb/notification-on-start-test.js | 5 ++-- ...password-inputs-can-be-pasted-into-test.js | 5 ++-- .../audits/dobetterweb/uses-http2-test.js | 2 +- .../uses-passive-event-listeners-test.js | 5 ++-- .../test/audits/errors-in-console-test.js | 5 ++-- .../test/audits/final-screenshot-test.js | 2 +- .../test/audits/font-display-test.js | 2 +- .../test/audits/image-aspect-ratio-test.js | 5 ++-- .../test/audits/image-size-responsive-test.js | 5 ++-- .../test/audits/installable-manifest-test.js | 5 ++-- .../test/audits/is-on-https-test.js | 5 ++-- .../largest-contentful-paint-element-test.js | 2 +- .../test/audits/layout-shift-elements-test.js | 2 +- .../test/audits/lcp-lazy-loaded-test.js | 2 +- .../test/audits/long-tasks-test.js | 2 +- .../test/audits/main-thread-tasks-test.js | 2 +- .../audits/mainthread-work-breakdown-test.js | 8 +++--- .../test/audits/manual-audit-test.js | 5 ++-- .../test/audits/maskable-icon-test.js | 2 +- lighthouse-core/test/audits/metrics-test.js | 2 +- .../metrics/cumulative-layout-shift-test.js | 2 +- ...rimental-interaction-to-next-paint-test.js | 2 +- .../metrics/first-contentful-paint-3g-test.js | 6 ++-- .../metrics/first-contentful-paint-test.js | 5 ++-- .../metrics/first-meaningful-paint-test.js | 5 ++-- .../test/audits/metrics/interactive-test.js | 5 ++-- .../metrics/largest-contentful-paint-test.js | 2 +- .../test/audits/metrics/speed-index-test.js | 9 +++--- .../metrics/total-blocking-time-test.js | 2 +- .../test/audits/network-requests-test.js | 2 +- .../test/audits/network-rtt-test.js | 2 +- .../audits/network-server-latency-test.js | 2 +- .../test/audits/no-unload-listeners-test.js | 2 +- .../audits/non-composited-animations-test.js | 2 +- .../test/audits/performance-budget-test.js | 2 +- .../test/audits/predictive-perf-test.js | 2 +- .../test/audits/preload-fonts-test.js | 2 +- .../test/audits/preload-lcp-image-test.js | 2 -- lighthouse-core/test/audits/redirects-test.js | 5 ++-- .../test/audits/resource-summary-test.js | 2 +- .../test/audits/screenshot-thumbnails-test.js | 3 +- .../test/audits/script-treemap-data-test.js | 3 +- .../test/audits/seo/canonical-test.js | 5 ++-- .../test/audits/seo/crawlable-anchors-test.js | 3 +- .../test/audits/seo/font-size-test.js | 5 ++-- .../test/audits/seo/hreflang-test.js | 3 +- .../test/audits/seo/http-status-code-test.js | 5 ++-- .../test/audits/seo/is-crawlable-test.js | 5 ++-- .../test/audits/seo/link-text-test.js | 5 ++-- .../test/audits/seo/meta-description-test.js | 5 ++-- .../test/audits/seo/plugins-test.js | 5 ++-- .../test/audits/seo/robots-txt-test.js | 5 ++-- .../test/audits/seo/tap-targets-test.js | 6 ++-- .../test/audits/server-response-time-test.js | 2 +- .../test/audits/service-worker-test.js | 5 ++-- .../test/audits/splash-screen-test.js | 3 +- .../test/audits/themed-omnibox-test.js | 5 ++-- .../test/audits/third-party-facades-test.js | 2 +- .../test/audits/third-party-summary-test.js | 2 +- .../test/audits/timing-budget-test.js | 2 +- .../test/audits/unsized-images-test.js | 2 +- .../test/audits/user-timing-test.js | 5 ++-- .../test/audits/uses-rel-preconnect-test.js | 5 ++-- .../test/audits/uses-rel-preload-test.js | 5 ++-- .../test/audits/valid-source-maps-test.js | 3 +- lighthouse-core/test/audits/viewport-test.js | 5 ++-- .../test/computed/computed-artifact-test.js | 2 +- .../computed/critical-request-chains-test.js | 2 +- .../test/computed/image-records-test.js | 3 +- .../test/computed/js-bundles-test.js | 3 +- .../test/computed/load-simulator-test.js | 2 +- .../test/computed/main-resource-test.js | 2 +- .../test/computed/main-thread-tasks-test.js | 3 +- .../test/computed/manifest-values-test.js | 2 +- .../metrics/cumulative-layout-shift-test.js | 2 +- .../first-contentful-paint-all-frames-test.js | 2 +- .../metrics/first-contentful-paint-test.js | 3 +- .../metrics/first-meaningful-paint-test.js | 5 ++-- .../test/computed/metrics/interactive-test.js | 5 ++-- .../lantern-first-contentful-paint-test.js | 5 ++-- .../lantern-first-meaningful-paint-test.js | 3 +- .../metrics/lantern-interactive-test.js | 5 ++-- .../lantern-largest-contentful-paint-test.js | 3 +- .../metrics/lantern-speed-index-test.js | 2 +- ...argest-contentful-paint-all-frames-test.js | 3 +- .../metrics/largest-contentful-paint-test.js | 3 +- .../metrics/max-potential-fid-test.js | 3 +- .../computed/metrics/responsiveness-test.js | 3 +- .../test/computed/metrics/speed-index-test.js | 3 +- .../computed/metrics/timing-summary-test.js | 2 +- .../metrics/total-blocking-time-test.js | 2 +- .../test/computed/module-duplication-test.js | 3 +- .../test/computed/network-analysis-test.js | 2 +- .../computed/page-dependency-graph-test.js | 5 ++-- .../computed/processed-navigation-test.js | 3 +- .../test/computed/processed-trace-test.js | 3 +- .../test/computed/resource-summary-test.js | 5 ++-- .../test/computed/screenshots-test.js | 6 ++-- .../test/computed/speedline-test.js | 2 +- .../test/computed/trace-of-tab-test.js | 3 +- .../test/computed/unused-css-test.js | 2 +- .../unused-javascript-summary-test.js | 3 +- .../test/computed/viewport-meta-test.js | 2 +- lighthouse-core/test/config/budget-test.js | 5 ++-- .../test/config/config-helpers-test.js | 5 ++-- .../test/config/config-plugin-test.js | 3 +- lighthouse-core/test/config/config-test.js | 8 ++++-- .../test/config/default-config-test.js | 3 +- lighthouse-core/test/create-test-trace.js | 2 +- .../plugin-no-category.js | 2 +- .../plugin-no-groups.js | 2 +- .../lighthouse-plugin-simple/plugin-simple.js | 2 +- .../test/fixtures/config/config/config.js | 2 +- .../plugin-config-helper.js | 2 +- .../fixtures/invalid-audits/missing-audit.js | 1 - .../invalid-audits/missing-description.js | 1 - .../missing-generate-audit-result.js | 1 - .../fixtures/invalid-audits/missing-id.js | 1 - .../fixtures/invalid-audits/missing-meta.js | 1 - .../missing-required-artifacts.js | 1 - .../fixtures/invalid-audits/missing-title.js | 1 - .../fixtures/invalid-audits/require-error.js | 2 +- .../invalid-gatherers/missing-after-pass.js | 1 - .../invalid-gatherers/missing-before-pass.js | 1 - .../invalid-gatherers/missing-pass.js | 1 - .../invalid-gatherers/require-error.js | 2 +- .../test/fixtures/valid-custom-audit.js | 1 - .../test/fixtures/valid-custom-gatherer.js | 1 - .../test/fraggle-rock/config/config-test.js | 3 +- .../test/fraggle-rock/config/filters-test.js | 5 ++-- .../fraggle-rock/config/validation-test.js | 2 +- .../gather/base-artifacts-test.js | 3 +- .../fraggle-rock/gather/base-gatherer-test.js | 2 +- .../test/fraggle-rock/gather/driver-test.js | 2 +- .../test/fraggle-rock/gather/mock-driver.js | 3 +- .../gather/navigation-runner-test.js | 3 +- .../gather/runner-helpers-test.js | 2 +- .../test/fraggle-rock/gather/session-test.js | 6 ++-- .../gather/snapshot-runner-test.js | 3 +- .../gather/timespan-runner-test.js | 3 +- .../fraggle-rock/scenarios/api-test-pptr.js | 2 +- .../scenarios/disconnect-test-pptr.js | 2 +- .../fraggle-rock/scenarios/pptr-test-utils.js | 11 ++++++-- .../test/fraggle-rock/user-flow-test.js | 3 +- .../test/gather/devtools-log-test.js | 2 +- lighthouse-core/test/gather/driver-test.js | 3 +- .../test/gather/driver/dom-test.js | 2 +- .../test/gather/driver/environment-test.js | 4 +-- .../gather/driver/execution-context-test.js | 3 +- .../test/gather/driver/navigation-test.js | 3 +- .../gather/driver/network-monitor-test.js | 3 +- .../test/gather/driver/prepare-test.js | 3 +- .../gather/driver/service-workers-test.js | 4 +-- .../test/gather/driver/storage-test.js | 3 +- .../test/gather/driver/target-manager-test.js | 3 +- .../gather/driver/wait-for-condition-test.js | 3 +- lighthouse-core/test/gather/fake-driver.js | 2 +- lighthouse-core/test/gather/fetcher-test.js | 3 +- .../test/gather/gather-runner-test.js | 6 ++-- .../gather/gatherers/accessibility-test.js | 3 +- .../gather/gatherers/cache-contents-test.js | 5 ++-- .../gather/gatherers/console-messages-test.js | 5 ++-- .../test/gather/gatherers/css-usage-test.js | 3 +- .../dobetterweb/optimized-images-test.js | 3 +- ...ssword-inputs-with-prevented-paste-test.js | 5 ++-- .../dobetterweb/response-compression-test.js | 2 +- .../tags-blocking-first-paint-test.js | 3 +- .../gatherers/full-page-screenshot-test.js | 3 +- .../test/gather/gatherers/gatherer-test.js | 5 ++-- .../gather/gatherers/global-listeners-test.js | 3 +- .../gather/gatherers/image-elements-test.js | 2 +- .../gather/gatherers/inspector-issues-test.js | 3 +- .../gatherers/installability-errors-test.js | 3 +- .../test/gather/gatherers/js-usage-test.js | 2 +- .../gather/gatherers/link-elements-test.js | 2 +- .../gatherers/main-document-content-test.js | 3 +- .../gatherers/network-user-agent-test.js | 2 +- .../gather/gatherers/script-elements-test.js | 2 +- .../gather/gatherers/seo/font-size-test.js | 2 +- .../gather/gatherers/service-worker-test.js | 6 ++-- .../test/gather/gatherers/source-maps-test.js | 2 +- .../test/gather/gatherers/stacks-test.js | 2 +- .../gather/gatherers/trace-elements-test.js | 3 +- .../test/gather/gatherers/trace-test.js | 3 +- .../gatherers/viewport-dimensions-test.js | 5 ++-- .../gather/gatherers/web-app-manifest-test.js | 5 ++-- lighthouse-core/test/gather/mock-commands.js | 2 +- lighthouse-core/test/index-test.js | 6 ++-- lighthouse-core/test/jest-setup/setup.js | 5 ++-- .../test/lib/arbitrary-equality-map-test.js | 2 +- lighthouse-core/test/lib/asset-saver-test.js | 7 +++-- .../test/lib/csp-evaluator-test.js | 7 +++-- .../lib/dependency-graph/base-node-test.js | 5 ++-- .../simulator/connection-pool-test.js | 5 ++-- .../simulator/dns-cache-test.js | 2 +- .../simulator/network-analyzer-test.js | 3 +- .../simulator/simulator-test.js | 5 ++-- .../simulator/tcp-connection-test.js | 5 ++-- lighthouse-core/test/lib/emulation-test.js | 2 +- lighthouse-core/test/lib/i18n/i18n-test.js | 8 ++++-- lighthouse-core/test/lib/icons-test.js | 5 ++-- .../lib/line-number-from-jsonld-path-test.js | 3 +- .../test/lib/manifest-parser-test.js | 5 ++-- lighthouse-core/test/lib/median-run-test.js | 2 +- .../test/lib/minification-estimator-test.js | 3 +- .../test/lib/minify-devtoolslog-test.js | 2 +- lighthouse-core/test/lib/minify-trace-test.js | 2 +- .../test/lib/navigation-error-test.js | 3 +- .../test/lib/network-recorder-test.js | 5 ++-- .../test/lib/network-request-test.js | 2 +- .../test/lib/page-functions-test.js | 4 ++- .../test/lib/proto-preprocessor-test.js | 2 +- lighthouse-core/test/lib/rect-helpers-test.js | 2 +- .../test/lib/sd-validation-test.js | 2 +- lighthouse-core/test/lib/sentry-test.js | 3 +- lighthouse-core/test/lib/stack-packs-test.js | 2 +- lighthouse-core/test/lib/statistics-test.js | 2 +- .../test/lib/tappable-rects-test.js | 6 ++-- .../test/lib/third-party-web-test.js | 2 +- .../test/lib/timing-trace-saver-test.js | 2 +- .../lib/tracehouse/cpu-profile-model-test.js | 3 +- .../lib/tracehouse/main-thread-tasks-test.js | 6 ++-- .../lib/tracehouse/trace-processor-test.js | 6 ++-- .../test/lib/traces/pwmetrics-events-test.js | 5 ++-- lighthouse-core/test/lib/url-shim-test.js | 5 ++-- .../network-records-to-devtools-log-test.js | 3 +- .../test/network-records-to-devtools-log.js | 2 +- lighthouse-core/test/results/sample-config.js | 2 +- lighthouse-core/test/runner-test.js | 10 ++++--- lighthouse-core/test/sample-json-test.js | 2 +- lighthouse-core/test/scoring-test.js | 3 +- .../test/scripts/i18n/bake-ctc-to-lhl-test.js | 2 +- .../test/scripts/i18n/collect-strings-test.js | 2 +- .../i18n/prune-obsolete-lhl-messages-test.js | 2 +- .../test/scripts/lantern/constants-test.js | 2 +- lighthouse-core/test/test-utils.js | 6 ++-- 302 files changed, 626 insertions(+), 479 deletions(-) create mode 100644 lighthouse-core/test/.eslintrc.cjs diff --git a/lighthouse-core/test/.eslintrc.cjs b/lighthouse-core/test/.eslintrc.cjs new file mode 100644 index 000000000000..bba28fbc9b4b --- /dev/null +++ b/lighthouse-core/test/.eslintrc.cjs @@ -0,0 +1,28 @@ +/** + * @license Copyright 2022 The Lighthouse Authors. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * 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. + */ + +module.exports = { + rules: { + // TODO(esmodules): move to root eslint when all code is ESM + // or when this is resolved: https://github.com/import-js/eslint-plugin-import/issues/2214 + 'import/order': [2, { + 'groups': [ + 'builtin', + 'external', + ['sibling', 'parent'], + 'index', + 'object', + 'type', + ], + 'newlines-between': 'always', + }], + 'import/group-exports': 2, + 'import/exports-last': 2, + }, + parserOptions: { + sourceType: 'module', + }, +}; diff --git a/lighthouse-core/test/audits/accessibility/aria-allowed-attr-test.js b/lighthouse-core/test/audits/accessibility/aria-allowed-attr-test.js index df2a14f76030..152db74851ec 100644 --- a/lighthouse-core/test/audits/accessibility/aria-allowed-attr-test.js +++ b/lighthouse-core/test/audits/accessibility/aria-allowed-attr-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/aria-allowed-attr.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/aria-allowed-attr.js'; + /* eslint-env jest */ describe('Accessibility: aria-allowed-attr audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/aria-required-attr-test.js b/lighthouse-core/test/audits/accessibility/aria-required-attr-test.js index c3ef64cdc5b9..2bea38f32893 100644 --- a/lighthouse-core/test/audits/accessibility/aria-required-attr-test.js +++ b/lighthouse-core/test/audits/accessibility/aria-required-attr-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/aria-required-attr.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/aria-required-attr.js'; + /* eslint-env jest */ describe('Accessibility: aria-required-attr audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/aria-required-children-test.js b/lighthouse-core/test/audits/accessibility/aria-required-children-test.js index 1a1d639c7f6f..37a23afc1f9d 100644 --- a/lighthouse-core/test/audits/accessibility/aria-required-children-test.js +++ b/lighthouse-core/test/audits/accessibility/aria-required-children-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/aria-required-children.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/aria-required-children.js'; + /* eslint-env jest */ describe('Accessibility: aria-required-children audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/aria-required-parent-test.js b/lighthouse-core/test/audits/accessibility/aria-required-parent-test.js index 2dc11913a991..f202d79b93a6 100644 --- a/lighthouse-core/test/audits/accessibility/aria-required-parent-test.js +++ b/lighthouse-core/test/audits/accessibility/aria-required-parent-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/aria-required-parent.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/aria-required-parent.js'; + /* eslint-env jest */ describe('Accessibility: aria-required-parent audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/aria-roles-test.js b/lighthouse-core/test/audits/accessibility/aria-roles-test.js index d7e410ed9362..14c20412b217 100644 --- a/lighthouse-core/test/audits/accessibility/aria-roles-test.js +++ b/lighthouse-core/test/audits/accessibility/aria-roles-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/aria-roles.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/aria-roles.js'; + /* eslint-env jest */ describe('Accessibility: aria-roles audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/aria-valid-attr-test.js b/lighthouse-core/test/audits/accessibility/aria-valid-attr-test.js index 75195ff2eb5e..efb22d057640 100644 --- a/lighthouse-core/test/audits/accessibility/aria-valid-attr-test.js +++ b/lighthouse-core/test/audits/accessibility/aria-valid-attr-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/aria-valid-attr.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/aria-valid-attr.js'; + /* eslint-env jest */ describe('Accessibility: aria-valid-attr audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/aria-valid-attr-value-test.js b/lighthouse-core/test/audits/accessibility/aria-valid-attr-value-test.js index 2c9fe097cca9..14367160404f 100644 --- a/lighthouse-core/test/audits/accessibility/aria-valid-attr-value-test.js +++ b/lighthouse-core/test/audits/accessibility/aria-valid-attr-value-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/aria-valid-attr-value.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/aria-valid-attr-value.js'; + /* eslint-env jest */ describe('Accessibility: aria-valid-attr-value audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/axe-audit-test.js b/lighthouse-core/test/audits/accessibility/axe-audit-test.js index 9f3667f7e441..0bbc36e82764 100644 --- a/lighthouse-core/test/audits/accessibility/axe-audit-test.js +++ b/lighthouse-core/test/audits/accessibility/axe-audit-test.js @@ -3,11 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import AxeAudit from '../../../audits/accessibility/axe-audit.js'; + import {strict as assert} from 'assert'; + import axeCore from 'axe-core'; + +import AxeAudit from '../../../audits/accessibility/axe-audit.js'; import Accesskeys from '../../../audits/accessibility/accesskeys.js'; import format from '../../../../shared/localization/format.js'; diff --git a/lighthouse-core/test/audits/accessibility/button-name-test.js b/lighthouse-core/test/audits/accessibility/button-name-test.js index 48da14179814..d8a81ced908f 100644 --- a/lighthouse-core/test/audits/accessibility/button-name-test.js +++ b/lighthouse-core/test/audits/accessibility/button-name-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/button-name.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/button-name.js'; + /* eslint-env jest */ describe('Accessibility: button-name audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/bypass-test.js b/lighthouse-core/test/audits/accessibility/bypass-test.js index be2e5fa47e45..bbdf15d1cfb4 100644 --- a/lighthouse-core/test/audits/accessibility/bypass-test.js +++ b/lighthouse-core/test/audits/accessibility/bypass-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/bypass.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/bypass.js'; + /* eslint-env jest */ describe('Accessibility: bypass audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/color-contrast-test.js b/lighthouse-core/test/audits/accessibility/color-contrast-test.js index ff1baa83490e..88b463a0c182 100644 --- a/lighthouse-core/test/audits/accessibility/color-contrast-test.js +++ b/lighthouse-core/test/audits/accessibility/color-contrast-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/color-contrast.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/color-contrast.js'; + /* eslint-env jest */ describe('Accessibility: color-contrast audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/definition-list-test.js b/lighthouse-core/test/audits/accessibility/definition-list-test.js index 53bd0fdf5eab..fbb6c64c0e60 100644 --- a/lighthouse-core/test/audits/accessibility/definition-list-test.js +++ b/lighthouse-core/test/audits/accessibility/definition-list-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/definition-list.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/definition-list.js'; + /* eslint-env jest */ describe('Accessibility: definition-list audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/dlitem-test.js b/lighthouse-core/test/audits/accessibility/dlitem-test.js index 63225ea0cb28..c8df52f58ece 100644 --- a/lighthouse-core/test/audits/accessibility/dlitem-test.js +++ b/lighthouse-core/test/audits/accessibility/dlitem-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/dlitem.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/dlitem.js'; + /* eslint-env jest */ describe('Accessibility: dlitem audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/document-title-test.js b/lighthouse-core/test/audits/accessibility/document-title-test.js index 375fd7e4e1a2..f8459d45f279 100644 --- a/lighthouse-core/test/audits/accessibility/document-title-test.js +++ b/lighthouse-core/test/audits/accessibility/document-title-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/document-title.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/document-title.js'; + /* eslint-env jest */ describe('Accessibility: document-title audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/frame-title-test.js b/lighthouse-core/test/audits/accessibility/frame-title-test.js index a60aa96c250e..25ce63fa642d 100644 --- a/lighthouse-core/test/audits/accessibility/frame-title-test.js +++ b/lighthouse-core/test/audits/accessibility/frame-title-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/frame-title.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/frame-title.js'; + /* eslint-env jest */ describe('Accessibility: frame-title audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/html-has-lang-test.js b/lighthouse-core/test/audits/accessibility/html-has-lang-test.js index a88769239dce..ead49ce8fad3 100644 --- a/lighthouse-core/test/audits/accessibility/html-has-lang-test.js +++ b/lighthouse-core/test/audits/accessibility/html-has-lang-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/html-has-lang.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/html-has-lang.js'; + /* eslint-env jest */ describe('Accessibility: html-has-lang audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/html-lang-valid-test.js b/lighthouse-core/test/audits/accessibility/html-lang-valid-test.js index 7cad0cdd9df0..4fadb66b2ff3 100644 --- a/lighthouse-core/test/audits/accessibility/html-lang-valid-test.js +++ b/lighthouse-core/test/audits/accessibility/html-lang-valid-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/html-lang-valid.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/html-lang-valid.js'; + /* eslint-env jest */ describe('Accessibility: html-lang-valid audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/image-alt-test.js b/lighthouse-core/test/audits/accessibility/image-alt-test.js index d05741ce3d03..42e53172afb0 100644 --- a/lighthouse-core/test/audits/accessibility/image-alt-test.js +++ b/lighthouse-core/test/audits/accessibility/image-alt-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/image-alt.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/image-alt.js'; + /* eslint-env jest */ describe('Accessibility: image-alt audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/input-image-alt-test.js b/lighthouse-core/test/audits/accessibility/input-image-alt-test.js index 6a8ffac4e808..0e11dff3d9db 100644 --- a/lighthouse-core/test/audits/accessibility/input-image-alt-test.js +++ b/lighthouse-core/test/audits/accessibility/input-image-alt-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/input-image-alt.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/input-image-alt.js'; + /* eslint-env jest */ describe('Accessibility: input-image-alt audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/label-test.js b/lighthouse-core/test/audits/accessibility/label-test.js index 0b944f9fa804..92d56d6a9b2f 100644 --- a/lighthouse-core/test/audits/accessibility/label-test.js +++ b/lighthouse-core/test/audits/accessibility/label-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/label.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/label.js'; + /* eslint-env jest */ describe('Accessibility: label audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/link-name-test.js b/lighthouse-core/test/audits/accessibility/link-name-test.js index 0ef55e71e5ac..2645b55ddb7d 100644 --- a/lighthouse-core/test/audits/accessibility/link-name-test.js +++ b/lighthouse-core/test/audits/accessibility/link-name-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/link-name.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/link-name.js'; + /* eslint-env jest */ describe('Accessibility: link-name audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/list-test.js b/lighthouse-core/test/audits/accessibility/list-test.js index a9c565e98867..44e9432dfa74 100644 --- a/lighthouse-core/test/audits/accessibility/list-test.js +++ b/lighthouse-core/test/audits/accessibility/list-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/list.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/list.js'; + /* eslint-env jest */ describe('Accessibility: list audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/listitem-test.js b/lighthouse-core/test/audits/accessibility/listitem-test.js index b0e59f349af4..ca39eb2ba96f 100644 --- a/lighthouse-core/test/audits/accessibility/listitem-test.js +++ b/lighthouse-core/test/audits/accessibility/listitem-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/listitem.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/listitem.js'; + /* eslint-env jest */ describe('Accessibility: listitem audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/meta-refresh-test.js b/lighthouse-core/test/audits/accessibility/meta-refresh-test.js index 3c77f5e5f2c5..905c6b36e107 100644 --- a/lighthouse-core/test/audits/accessibility/meta-refresh-test.js +++ b/lighthouse-core/test/audits/accessibility/meta-refresh-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/meta-refresh.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/meta-refresh.js'; + /* eslint-env jest */ describe('Accessibility: meta-refresh audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/meta-viewport-test.js b/lighthouse-core/test/audits/accessibility/meta-viewport-test.js index fef9040ffab3..351dd0e3720f 100644 --- a/lighthouse-core/test/audits/accessibility/meta-viewport-test.js +++ b/lighthouse-core/test/audits/accessibility/meta-viewport-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/meta-viewport.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/meta-viewport.js'; + /* eslint-env jest */ describe('Accessibility: meta-viewport audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/object-alt-test.js b/lighthouse-core/test/audits/accessibility/object-alt-test.js index d39187ae90e0..258fe4206755 100644 --- a/lighthouse-core/test/audits/accessibility/object-alt-test.js +++ b/lighthouse-core/test/audits/accessibility/object-alt-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/object-alt.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/object-alt.js'; + /* eslint-env jest */ describe('Accessibility: object-alt audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/tabindex-test.js b/lighthouse-core/test/audits/accessibility/tabindex-test.js index 5aec2ed6d550..9d9879712b86 100644 --- a/lighthouse-core/test/audits/accessibility/tabindex-test.js +++ b/lighthouse-core/test/audits/accessibility/tabindex-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/tabindex.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/tabindex.js'; + /* eslint-env jest */ describe('Accessibility: tabindex audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/td-headers-attr-test.js b/lighthouse-core/test/audits/accessibility/td-headers-attr-test.js index e03b738e56d4..9d546c7b2c0e 100644 --- a/lighthouse-core/test/audits/accessibility/td-headers-attr-test.js +++ b/lighthouse-core/test/audits/accessibility/td-headers-attr-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/td-headers-attr.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/td-headers-attr.js'; + /* eslint-env jest */ describe('Accessibility: td-headers-attr audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/th-has-data-cells-test.js b/lighthouse-core/test/audits/accessibility/th-has-data-cells-test.js index 58e4df7496be..ac58cd753092 100644 --- a/lighthouse-core/test/audits/accessibility/th-has-data-cells-test.js +++ b/lighthouse-core/test/audits/accessibility/th-has-data-cells-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/th-has-data-cells.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/th-has-data-cells.js'; + /* eslint-env jest */ describe('Accessibility: th-has-data-cells audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/valid-lang-test.js b/lighthouse-core/test/audits/accessibility/valid-lang-test.js index 9c6c0aedbd3d..8e9a8eae512a 100644 --- a/lighthouse-core/test/audits/accessibility/valid-lang-test.js +++ b/lighthouse-core/test/audits/accessibility/valid-lang-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/valid-lang.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/valid-lang.js'; + /* eslint-env jest */ describe('Accessibility: valid-lang audit', () => { diff --git a/lighthouse-core/test/audits/accessibility/video-caption-test.js b/lighthouse-core/test/audits/accessibility/video-caption-test.js index c8e6a0331ab2..1a0c3bf62e6f 100644 --- a/lighthouse-core/test/audits/accessibility/video-caption-test.js +++ b/lighthouse-core/test/audits/accessibility/video-caption-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/accessibility/video-caption.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/accessibility/video-caption.js'; + /* eslint-env jest */ describe('Accessibility: video-caption audit', () => { diff --git a/lighthouse-core/test/audits/apple-touch-icon-test.js b/lighthouse-core/test/audits/apple-touch-icon-test.js index dabff7e3bbe3..68e7f0c6ecb2 100644 --- a/lighthouse-core/test/audits/apple-touch-icon-test.js +++ b/lighthouse-core/test/audits/apple-touch-icon-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import AppleTouchIcon from '../../audits/apple-touch-icon.js'; diff --git a/lighthouse-core/test/audits/audit-test.js b/lighthouse-core/test/audits/audit-test.js index e2a096d522f8..44539978ff4f 100644 --- a/lighthouse-core/test/audits/audit-test.js +++ b/lighthouse-core/test/audits/audit-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../audits/audit.js'; + import {strict as assert} from 'assert'; +import Audit from '../../audits/audit.js'; + /* eslint-env jest */ // Extend the Audit class but fail to implement meta. It should throw errors. diff --git a/lighthouse-core/test/audits/autocomplete-test.js b/lighthouse-core/test/audits/autocomplete-test.js index ca5e3fa25e1e..87a9ed60c45d 100644 --- a/lighthouse-core/test/audits/autocomplete-test.js +++ b/lighthouse-core/test/audits/autocomplete-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/bootup-time-test.js b/lighthouse-core/test/audits/bootup-time-test.js index 38a91ada3155..22364881c693 100644 --- a/lighthouse-core/test/audits/bootup-time-test.js +++ b/lighthouse-core/test/audits/bootup-time-test.js @@ -3,13 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -/* eslint-env jest */ -import BootupTime from '../../audits/bootup-time.js'; +/* eslint-env jest */ import {strict as assert} from 'assert'; + +import BootupTime from '../../audits/bootup-time.js'; import acceptableTrace from '../fixtures/traces/progressive-app-m60.json'; import acceptableDevtoolsLogs from '../fixtures/traces/progressive-app-m60.devtools.log.json'; import errorTrace from '../fixtures/traces/no_fmp_event.json'; diff --git a/lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js b/lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js index db39adc654c6..6f71b7d83e28 100644 --- a/lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js @@ -3,7 +3,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import ByteEfficiencyAudit_ from '../../../audits/byte-efficiency/byte-efficiency-audit.js'; import NetworkNode from '../../../lib/dependency-graph/network-node.js'; @@ -16,7 +18,6 @@ import devtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log. import traceM78 from '../../fixtures/traces/lcp-m78.json'; import devtoolsLogM78 from '../../fixtures/traces/lcp-m78.devtools.log.json'; import {getURLArtifactFromDevtoolsLog} from '../../test-utils.js'; -import {strict as assert} from 'assert'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/byte-efficiency/duplicated-javascript-test.js b/lighthouse-core/test/audits/byte-efficiency/duplicated-javascript-test.js index f48af5b3185d..9f3c095e4ea4 100644 --- a/lighthouse-core/test/audits/byte-efficiency/duplicated-javascript-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/duplicated-javascript-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import DuplicatedJavascript from '../../../audits/byte-efficiency/duplicated-javascript.js'; - import trace from '../../fixtures/traces/lcp-m78.json'; import devtoolsLog from '../../fixtures/traces/lcp-m78.devtools.log.json'; import { diff --git a/lighthouse-core/test/audits/byte-efficiency/efficient-animated-content-test.js b/lighthouse-core/test/audits/byte-efficiency/efficient-animated-content-test.js index d4c5c0b0e6f4..09a98d3fbf0e 100644 --- a/lighthouse-core/test/audits/byte-efficiency/efficient-animated-content-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/efficient-animated-content-test.js @@ -3,15 +3,15 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import {strict as assert} from 'assert'; + import EfficientAnimatedContent from '../../../audits/byte-efficiency/efficient-animated-content.js'; - import NetworkRequest from '../../../lib/network-request.js'; -import {strict as assert} from 'assert'; describe('Page uses videos for animated GIFs', () => { it('should flag gifs above 100kb as unoptimized', async () => { diff --git a/lighthouse-core/test/audits/byte-efficiency/legacy-javascript-test.js b/lighthouse-core/test/audits/byte-efficiency/legacy-javascript-test.js index bd771f5bd1e9..2889cd30ff3d 100644 --- a/lighthouse-core/test/audits/byte-efficiency/legacy-javascript-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/legacy-javascript-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {readJson} from '../../../../root.js'; import LegacyJavascript from '../../../audits/byte-efficiency/legacy-javascript.js'; diff --git a/lighthouse-core/test/audits/byte-efficiency/modern-image-formats-test.js b/lighthouse-core/test/audits/byte-efficiency/modern-image-formats-test.js index 04c694631c9b..b4c5f37ee3ad 100644 --- a/lighthouse-core/test/audits/byte-efficiency/modern-image-formats-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/modern-image-formats-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import ModernImageFormats from '../../../audits/byte-efficiency/modern-image-formats.js'; diff --git a/lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js b/lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js index a4ade39e3f8f..40168788b59b 100644 --- a/lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import UnusedImages from '../../../audits/byte-efficiency/offscreen-images.js'; + import {strict as assert} from 'assert'; + +import UnusedImages from '../../../audits/byte-efficiency/offscreen-images.js'; import createTestTrace from '../../create-test-trace.js'; import networkRecordsToDevtoolsLog from '../../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/byte-efficiency/render-blocking-resources-test.js b/lighthouse-core/test/audits/byte-efficiency/render-blocking-resources-test.js index 8a06460bc482..3c72c43fb492 100644 --- a/lighthouse-core/test/audits/byte-efficiency/render-blocking-resources-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/render-blocking-resources-test.js @@ -3,7 +3,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import RenderBlockingResourcesAudit from '../../../audits/byte-efficiency/render-blocking-resources.js'; // eslint-disable-line max-len import constants from '../../../config/constants.js'; @@ -11,7 +13,6 @@ import NetworkNode from '../../../lib/dependency-graph/network-node.js'; import CPUNode from '../../../lib/dependency-graph/cpu-node.js'; import Simulator from '../../../lib/dependency-graph/simulator/simulator.js'; import NetworkRequest from '../../../lib/network-request.js'; -import {strict as assert} from 'assert'; import trace from '../../fixtures/traces/progressive-app-m60.json'; import devtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; import ampTrace from '../../fixtures/traces/amp-m86.trace.json'; diff --git a/lighthouse-core/test/audits/byte-efficiency/total-byte-weight-test.js b/lighthouse-core/test/audits/byte-efficiency/total-byte-weight-test.js index 1f6c9454fc2d..24947e418ed4 100644 --- a/lighthouse-core/test/audits/byte-efficiency/total-byte-weight-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/total-byte-weight-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {strict as assert} from 'assert'; import {URL} from 'url'; + import TotalByteWeight from '../../../audits/byte-efficiency/total-byte-weight.js'; import networkRecordsToDevtoolsLog from '../../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/byte-efficiency/unminified-css-test.js b/lighthouse-core/test/audits/byte-efficiency/unminified-css-test.js index 7cc731ce4502..1169abee2f5f 100644 --- a/lighthouse-core/test/audits/byte-efficiency/unminified-css-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/unminified-css-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + const KB = 1024; -import UnminifiedCssAudit from '../../../audits/byte-efficiency/unminified-css.js'; import {strict as assert} from 'assert'; +import UnminifiedCssAudit from '../../../audits/byte-efficiency/unminified-css.js'; + /* eslint-env jest */ const resourceType = 'Stylesheet'; diff --git a/lighthouse-core/test/audits/byte-efficiency/unminified-javascript-test.js b/lighthouse-core/test/audits/byte-efficiency/unminified-javascript-test.js index 7e7373a891e4..3db3ea0af10c 100644 --- a/lighthouse-core/test/audits/byte-efficiency/unminified-javascript-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/unminified-javascript-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import UnminifiedJavascriptAudit from '../../../audits/byte-efficiency/unminified-javascript.js'; + import {strict as assert} from 'assert'; + +import UnminifiedJavascriptAudit from '../../../audits/byte-efficiency/unminified-javascript.js'; import {createScript} from '../../test-utils.js'; const KB = 1024; diff --git a/lighthouse-core/test/audits/byte-efficiency/unused-css-rules-test.js b/lighthouse-core/test/audits/byte-efficiency/unused-css-rules-test.js index 45872f602d22..67264013c7dd 100644 --- a/lighthouse-core/test/audits/byte-efficiency/unused-css-rules-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/unused-css-rules-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import UnusedCSSAudit from '../../../audits/byte-efficiency/unused-css-rules.js'; + import {strict as assert} from 'assert'; + +import UnusedCSSAudit from '../../../audits/byte-efficiency/unused-css-rules.js'; import networkRecordsToDevtoolsLog from '../../network-records-to-devtools-log.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/byte-efficiency/unused-javascript-test.js b/lighthouse-core/test/audits/byte-efficiency/unused-javascript-test.js index 9eaac16a7702..06bf8d08dcb4 100644 --- a/lighthouse-core/test/audits/byte-efficiency/unused-javascript-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/unused-javascript-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import UnusedJavaScript from '../../../audits/byte-efficiency/unused-javascript.js'; import networkRecordsToDevtoolsLog from '../../network-records-to-devtools-log.js'; import {createScript, loadSourceMapAndUsageFixture} from '../../test-utils.js'; diff --git a/lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js b/lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js index 24c51cb851d6..132ab2c3cf43 100644 --- a/lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import CacheHeadersAudit from '../../../audits/byte-efficiency/uses-long-cache-ttl.js'; + import {strict as assert} from 'assert'; + +import CacheHeadersAudit from '../../../audits/byte-efficiency/uses-long-cache-ttl.js'; import NetworkRequest from '../../../lib/network-request.js'; const options = CacheHeadersAudit.defaultOptions; import networkRecordsToDevtoolsLog from '../../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/byte-efficiency/uses-optimized-images-test.js b/lighthouse-core/test/audits/byte-efficiency/uses-optimized-images-test.js index b95a5bcfed92..ed59be2fbd6f 100644 --- a/lighthouse-core/test/audits/byte-efficiency/uses-optimized-images-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/uses-optimized-images-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import OptimizedImagesAudit from '../../../audits/byte-efficiency/uses-optimized-images.js'; diff --git a/lighthouse-core/test/audits/byte-efficiency/uses-responsive-images-snapshot-test.js b/lighthouse-core/test/audits/byte-efficiency/uses-responsive-images-snapshot-test.js index ef81c0561100..aa29443b679c 100644 --- a/lighthouse-core/test/audits/byte-efficiency/uses-responsive-images-snapshot-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/uses-responsive-images-snapshot-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import UsesResponsiveImagesSnapshot from '../../../audits/byte-efficiency/uses-responsive-images-snapshot.js'; diff --git a/lighthouse-core/test/audits/byte-efficiency/uses-responsive-images-test.js b/lighthouse-core/test/audits/byte-efficiency/uses-responsive-images-test.js index 0edce921e2f1..51a57b175fb6 100644 --- a/lighthouse-core/test/audits/byte-efficiency/uses-responsive-images-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/uses-responsive-images-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import UsesResponsiveImagesAudit from '../../../audits/byte-efficiency/uses-responsive-images.js'; + import {strict as assert} from 'assert'; +import UsesResponsiveImagesAudit from '../../../audits/byte-efficiency/uses-responsive-images.js'; + /* eslint-env jest */ function generateRecord(resourceSizeInKb, durationInMs, url = 'https://google.com/logo.png', mimeType = 'image/png') { return { diff --git a/lighthouse-core/test/audits/byte-efficiency/uses-text-compression-test.js b/lighthouse-core/test/audits/byte-efficiency/uses-text-compression-test.js index af1b1b670286..a2525a1c15b3 100644 --- a/lighthouse-core/test/audits/byte-efficiency/uses-text-compression-test.js +++ b/lighthouse-core/test/audits/byte-efficiency/uses-text-compression-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + const KB = 1024; -import ResponsesAreCompressedAudit from '../../../audits/byte-efficiency/uses-text-compression.js'; import {strict as assert} from 'assert'; +import ResponsesAreCompressedAudit from '../../../audits/byte-efficiency/uses-text-compression.js'; + function generateResponse(options) { return Object.assign({ url: `http://google.com/${options.file}`, diff --git a/lighthouse-core/test/audits/content-width-test.js b/lighthouse-core/test/audits/content-width-test.js index 4b8c445f689f..01a7f9ff389b 100644 --- a/lighthouse-core/test/audits/content-width-test.js +++ b/lighthouse-core/test/audits/content-width-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import Audit from '../../audits/content-width.js'; import constants from '../../config/constants.js'; -import {strict as assert} from 'assert'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/critical-request-chains-test.js b/lighthouse-core/test/audits/critical-request-chains-test.js index 0e9768093741..d82a5c72339c 100644 --- a/lighthouse-core/test/audits/critical-request-chains-test.js +++ b/lighthouse-core/test/audits/critical-request-chains-test.js @@ -3,14 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import CriticalRequestChains from '../../audits/critical-request-chains.js'; +import {strict as assert} from 'assert'; +import CriticalRequestChains from '../../audits/critical-request-chains.js'; import redditDevtoolsLog from '../fixtures/artifacts/perflog/defaultPass.devtoolslog.json'; -import {strict as assert} from 'assert'; import createTestTrace from '../create-test-trace.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/csp-xss-test.js b/lighthouse-core/test/audits/csp-xss-test.js index 7d54f955a4f6..2f51326f2559 100644 --- a/lighthouse-core/test/audits/csp-xss-test.js +++ b/lighthouse-core/test/audits/csp-xss-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import CspXss from '../../audits/csp-xss.js'; + import {Type} from 'csp_evaluator/dist/finding.js'; + +import CspXss from '../../audits/csp-xss.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/deprecations-test.js b/lighthouse-core/test/audits/deprecations-test.js index 7fb31a3c19c6..98d7f92f6681 100644 --- a/lighthouse-core/test/audits/deprecations-test.js +++ b/lighthouse-core/test/audits/deprecations-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import DeprecationsAudit from '../../audits/deprecations.js'; + import {strict as assert} from 'assert'; +import DeprecationsAudit from '../../audits/deprecations.js'; + /* eslint-env jest */ describe('Deprecations audit', () => { diff --git a/lighthouse-core/test/audits/diagnostics-test.js b/lighthouse-core/test/audits/diagnostics-test.js index 3091828a85ac..a212ca41f8a7 100644 --- a/lighthouse-core/test/audits/diagnostics-test.js +++ b/lighthouse-core/test/audits/diagnostics-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import Diagnostics from '../../audits/diagnostics.js'; import acceptableTrace from '../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/audits/dobetterweb/charset-test.js b/lighthouse-core/test/audits/dobetterweb/charset-test.js index cec9bccfb45c..3115c31bd305 100644 --- a/lighthouse-core/test/audits/dobetterweb/charset-test.js +++ b/lighthouse-core/test/audits/dobetterweb/charset-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import CharsetDefinedAudit from '../../../audits/dobetterweb/charset.js'; + import {strict as assert} from 'assert'; + +import CharsetDefinedAudit from '../../../audits/dobetterweb/charset.js'; import networkRecordsToDevtoolsLog from '../../network-records-to-devtools-log.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/dobetterweb/doctype-test.js b/lighthouse-core/test/audits/dobetterweb/doctype-test.js index c60724b2f3f8..91ceeae32b38 100644 --- a/lighthouse-core/test/audits/dobetterweb/doctype-test.js +++ b/lighthouse-core/test/audits/dobetterweb/doctype-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/dobetterweb/doctype.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/dobetterweb/doctype.js'; + /* eslint-env jest */ describe('DOBETTERWEB: doctype audit', () => { diff --git a/lighthouse-core/test/audits/dobetterweb/dom-size-test.js b/lighthouse-core/test/audits/dobetterweb/dom-size-test.js index 870cf22bdcb0..6ac23f4e9d88 100644 --- a/lighthouse-core/test/audits/dobetterweb/dom-size-test.js +++ b/lighthouse-core/test/audits/dobetterweb/dom-size-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import DOMSize from '../../../audits/dobetterweb/dom-size.js'; + import {strict as assert} from 'assert'; + +import DOMSize from '../../../audits/dobetterweb/dom-size.js'; const options = DOMSize.defaultOptions; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/dobetterweb/geolocation-on-start-test.js b/lighthouse-core/test/audits/dobetterweb/geolocation-on-start-test.js index f5764c5612ec..82ec84324a9f 100644 --- a/lighthouse-core/test/audits/dobetterweb/geolocation-on-start-test.js +++ b/lighthouse-core/test/audits/dobetterweb/geolocation-on-start-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import GeolocationOnStartAudit from '../../../audits/dobetterweb/geolocation-on-start.js'; + import {strict as assert} from 'assert'; +import GeolocationOnStartAudit from '../../../audits/dobetterweb/geolocation-on-start.js'; + /* eslint-env jest */ describe('UX: geolocation audit', () => { diff --git a/lighthouse-core/test/audits/dobetterweb/inspector-issues-test.js b/lighthouse-core/test/audits/dobetterweb/inspector-issues-test.js index 6dc0b173ab9a..21a273aa60c0 100644 --- a/lighthouse-core/test/audits/dobetterweb/inspector-issues-test.js +++ b/lighthouse-core/test/audits/dobetterweb/inspector-issues-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import InspectorIssuesAudit from '../../../audits/dobetterweb/inspector-issues.js'; diff --git a/lighthouse-core/test/audits/dobetterweb/js-libraries-test.js b/lighthouse-core/test/audits/dobetterweb/js-libraries-test.js index 2539969d17e6..16387d18ac03 100644 --- a/lighthouse-core/test/audits/dobetterweb/js-libraries-test.js +++ b/lighthouse-core/test/audits/dobetterweb/js-libraries-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import JsLibrariesAudit from '../../../audits/dobetterweb/js-libraries.js'; + import {strict as assert} from 'assert'; +import JsLibrariesAudit from '../../../audits/dobetterweb/js-libraries.js'; + /* eslint-env jest */ describe('Returns detected front-end JavaScript libraries', () => { it('not applicable when there are no stacks', () => { diff --git a/lighthouse-core/test/audits/dobetterweb/no-document-write-test.js b/lighthouse-core/test/audits/dobetterweb/no-document-write-test.js index 4164123b9ee2..e0536f46a3bf 100644 --- a/lighthouse-core/test/audits/dobetterweb/no-document-write-test.js +++ b/lighthouse-core/test/audits/dobetterweb/no-document-write-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import DocWriteUseAudit from '../../../audits/dobetterweb/no-document-write.js'; + import {strict as assert} from 'assert'; +import DocWriteUseAudit from '../../../audits/dobetterweb/no-document-write.js'; + const URL = 'https://example.com'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/dobetterweb/no-vulnerable-libraries-test.js b/lighthouse-core/test/audits/dobetterweb/no-vulnerable-libraries-test.js index 51fad66c0f26..d3fe4e8aebc6 100644 --- a/lighthouse-core/test/audits/dobetterweb/no-vulnerable-libraries-test.js +++ b/lighthouse-core/test/audits/dobetterweb/no-vulnerable-libraries-test.js @@ -3,12 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import NoVulnerableLibrariesAudit from '../../../audits/dobetterweb/no-vulnerable-libraries.js'; + import {strict as assert} from 'assert'; + import semver from 'semver'; +import NoVulnerableLibrariesAudit from '../../../audits/dobetterweb/no-vulnerable-libraries.js'; + /* eslint-env jest */ describe('Avoids front-end JavaScript libraries with known vulnerabilities', () => { describe('#normalizeVersion', () => { diff --git a/lighthouse-core/test/audits/dobetterweb/notification-on-start-test.js b/lighthouse-core/test/audits/dobetterweb/notification-on-start-test.js index b6f86f8326b3..6ec513cc4d2e 100644 --- a/lighthouse-core/test/audits/dobetterweb/notification-on-start-test.js +++ b/lighthouse-core/test/audits/dobetterweb/notification-on-start-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import NotificationOnStart from '../../../audits/dobetterweb/notification-on-start.js'; + import {strict as assert} from 'assert'; +import NotificationOnStart from '../../../audits/dobetterweb/notification-on-start.js'; + /* eslint-env jest */ describe('UX: notification audit', () => { diff --git a/lighthouse-core/test/audits/dobetterweb/password-inputs-can-be-pasted-into-test.js b/lighthouse-core/test/audits/dobetterweb/password-inputs-can-be-pasted-into-test.js index 12685cb0bf2b..2cfc002acb81 100644 --- a/lighthouse-core/test/audits/dobetterweb/password-inputs-can-be-pasted-into-test.js +++ b/lighthouse-core/test/audits/dobetterweb/password-inputs-can-be-pasted-into-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import PasswordInputsCanBePastedIntoAudit from '../../../audits/dobetterweb/password-inputs-can-be-pasted-into.js'; -import {strict as assert} from 'assert'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js b/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js index 075ebe655360..5b0b8d63a186 100644 --- a/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js +++ b/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import UsesHTTP2Audit from '../../../audits/dobetterweb/uses-http2.js'; import trace from '../../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/audits/dobetterweb/uses-passive-event-listeners-test.js b/lighthouse-core/test/audits/dobetterweb/uses-passive-event-listeners-test.js index c202fbf0efcc..29023c038fc2 100644 --- a/lighthouse-core/test/audits/dobetterweb/uses-passive-event-listeners-test.js +++ b/lighthouse-core/test/audits/dobetterweb/uses-passive-event-listeners-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import PassiveEventsAudit from '../../../audits/dobetterweb/uses-passive-event-listeners.js'; + import {strict as assert} from 'assert'; +import PassiveEventsAudit from '../../../audits/dobetterweb/uses-passive-event-listeners.js'; + /* eslint-env jest */ describe('Page uses passive events listeners where applicable', () => { diff --git a/lighthouse-core/test/audits/errors-in-console-test.js b/lighthouse-core/test/audits/errors-in-console-test.js index b10d9b04770e..f0758c1b2524 100644 --- a/lighthouse-core/test/audits/errors-in-console-test.js +++ b/lighthouse-core/test/audits/errors-in-console-test.js @@ -3,13 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import {strict as assert} from 'assert'; + import ErrorLogsAudit from '../../audits/errors-in-console.js'; -import {strict as assert} from 'assert'; describe('ConsoleMessages error logs audit', () => { it('passes when no console messages were found', async () => { diff --git a/lighthouse-core/test/audits/final-screenshot-test.js b/lighthouse-core/test/audits/final-screenshot-test.js index 8f347c0f1fee..2b59ced10f32 100644 --- a/lighthouse-core/test/audits/final-screenshot-test.js +++ b/lighthouse-core/test/audits/final-screenshot-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import FinalScreenshotAudit from '../../audits/final-screenshot.js'; import pwaTrace from '../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/audits/font-display-test.js b/lighthouse-core/test/audits/font-display-test.js index 21c25bb4aa1d..658127a73d08 100644 --- a/lighthouse-core/test/audits/font-display-test.js +++ b/lighthouse-core/test/audits/font-display-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import FontDisplayAudit from '../../audits/font-display.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/image-aspect-ratio-test.js b/lighthouse-core/test/audits/image-aspect-ratio-test.js index 67ed0404b74b..60a7028f86bc 100644 --- a/lighthouse-core/test/audits/image-aspect-ratio-test.js +++ b/lighthouse-core/test/audits/image-aspect-ratio-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import ImageAspectRatioAudit from '../../audits/image-aspect-ratio.js'; + import {strict as assert} from 'assert'; +import ImageAspectRatioAudit from '../../audits/image-aspect-ratio.js'; + /* eslint-env jest */ function generateImage(clientSize, naturalDimensions, props, src = 'https://google.com/logo.png') { diff --git a/lighthouse-core/test/audits/image-size-responsive-test.js b/lighthouse-core/test/audits/image-size-responsive-test.js index c1607a83f9bc..da0a839b70d3 100644 --- a/lighthouse-core/test/audits/image-size-responsive-test.js +++ b/lighthouse-core/test/audits/image-size-responsive-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import ImageSizeResponsiveAudit from '../../audits/image-size-responsive.js'; + import {strict as assert} from 'assert'; +import ImageSizeResponsiveAudit from '../../audits/image-size-responsive.js'; + /* eslint-env jest */ const WIDTH = 800; diff --git a/lighthouse-core/test/audits/installable-manifest-test.js b/lighthouse-core/test/audits/installable-manifest-test.js index 3d464faffd4a..8793142eb999 100644 --- a/lighthouse-core/test/audits/installable-manifest-test.js +++ b/lighthouse-core/test/audits/installable-manifest-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import InstallableManifestAudit from '../../audits/installable-manifest.js'; + import {strict as assert} from 'assert'; + +import InstallableManifestAudit from '../../audits/installable-manifest.js'; import manifestParser from '../../lib/manifest-parser.js'; import manifest from '../fixtures/manifest.json'; import manifestDirtyJpg from '../fixtures/manifest-dirty-jpg.json'; diff --git a/lighthouse-core/test/audits/is-on-https-test.js b/lighthouse-core/test/audits/is-on-https-test.js index 262856dfd9a1..87a3be155e8c 100644 --- a/lighthouse-core/test/audits/is-on-https-test.js +++ b/lighthouse-core/test/audits/is-on-https-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../audits/is-on-https.js'; + import {strict as assert} from 'assert'; + +import Audit from '../../audits/is-on-https.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/largest-contentful-paint-element-test.js b/lighthouse-core/test/audits/largest-contentful-paint-element-test.js index cfb43c086d99..bac4ab16d476 100644 --- a/lighthouse-core/test/audits/largest-contentful-paint-element-test.js +++ b/lighthouse-core/test/audits/largest-contentful-paint-element-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import LargestContentfulPaintElementAudit from '../../audits/largest-contentful-paint-element.js'; diff --git a/lighthouse-core/test/audits/layout-shift-elements-test.js b/lighthouse-core/test/audits/layout-shift-elements-test.js index 36d9559747a2..731c7ee48f1f 100644 --- a/lighthouse-core/test/audits/layout-shift-elements-test.js +++ b/lighthouse-core/test/audits/layout-shift-elements-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import LayoutShiftElementsAudit from '../../audits/layout-shift-elements.js'; diff --git a/lighthouse-core/test/audits/lcp-lazy-loaded-test.js b/lighthouse-core/test/audits/lcp-lazy-loaded-test.js index 1e6a1473131d..095f3ec284a7 100644 --- a/lighthouse-core/test/audits/lcp-lazy-loaded-test.js +++ b/lighthouse-core/test/audits/lcp-lazy-loaded-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import LargestContentfulPaintLazyLoaded from '../../audits/lcp-lazy-loaded.js'; diff --git a/lighthouse-core/test/audits/long-tasks-test.js b/lighthouse-core/test/audits/long-tasks-test.js index 8c839fa4e182..07554fa1d75b 100644 --- a/lighthouse-core/test/audits/long-tasks-test.js +++ b/lighthouse-core/test/audits/long-tasks-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import LongTasks from '../../audits/long-tasks.js'; import createTestTrace from '../create-test-trace.js'; diff --git a/lighthouse-core/test/audits/main-thread-tasks-test.js b/lighthouse-core/test/audits/main-thread-tasks-test.js index 4a41952566bc..ea02f8c9dcc5 100644 --- a/lighthouse-core/test/audits/main-thread-tasks-test.js +++ b/lighthouse-core/test/audits/main-thread-tasks-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import MainThreadTasks from '../../audits/main-thread-tasks.js'; import acceptableTrace from '../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/audits/mainthread-work-breakdown-test.js b/lighthouse-core/test/audits/mainthread-work-breakdown-test.js index 13093616a4d5..6297e244e016 100644 --- a/lighthouse-core/test/audits/mainthread-work-breakdown-test.js +++ b/lighthouse-core/test/audits/mainthread-work-breakdown-test.js @@ -3,19 +3,19 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -/* eslint-env jest */ -import PageExecutionTimings from '../../audits/mainthread-work-breakdown.js'; +/* eslint-env jest */ import {strict as assert} from 'assert'; -const options = PageExecutionTimings.defaultOptions; +import PageExecutionTimings from '../../audits/mainthread-work-breakdown.js'; import acceptableTrace from '../fixtures/traces/progressive-app-m60.json'; import siteWithRedirectTrace from '../fixtures/traces/site-with-redirect.json'; import loadTrace from '../fixtures/traces/load.json'; import errorTrace from '../fixtures/traces/no_fmp_event.json'; +const options = PageExecutionTimings.defaultOptions; + const acceptableTraceExpectations = { parseHTML: 14, styleLayout: 308, diff --git a/lighthouse-core/test/audits/manual-audit-test.js b/lighthouse-core/test/audits/manual-audit-test.js index 6034a52025c3..ee644a5fb00d 100644 --- a/lighthouse-core/test/audits/manual-audit-test.js +++ b/lighthouse-core/test/audits/manual-audit-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import ManualAudit from '../../audits/manual/manual-audit.js'; + import {strict as assert} from 'assert'; +import ManualAudit from '../../audits/manual/manual-audit.js'; + /* eslint-env jest */ // Extend the Audit class but fail to implement meta. It should throw errors. diff --git a/lighthouse-core/test/audits/maskable-icon-test.js b/lighthouse-core/test/audits/maskable-icon-test.js index 1766ae109a3d..3acc3d203680 100644 --- a/lighthouse-core/test/audits/maskable-icon-test.js +++ b/lighthouse-core/test/audits/maskable-icon-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import MaskableIconAudit from '../../audits/maskable-icon.js'; import manifestParser from '../../lib/manifest-parser.js'; diff --git a/lighthouse-core/test/audits/metrics-test.js b/lighthouse-core/test/audits/metrics-test.js index 0ef05cb40e8e..bef36ca8c4ad 100644 --- a/lighthouse-core/test/audits/metrics-test.js +++ b/lighthouse-core/test/audits/metrics-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {jest} from '@jest/globals'; diff --git a/lighthouse-core/test/audits/metrics/cumulative-layout-shift-test.js b/lighthouse-core/test/audits/metrics/cumulative-layout-shift-test.js index aafce7d3ce54..5e233ec62ffe 100644 --- a/lighthouse-core/test/audits/metrics/cumulative-layout-shift-test.js +++ b/lighthouse-core/test/audits/metrics/cumulative-layout-shift-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import CumulativeLayoutShift from '../../../audits/metrics/cumulative-layout-shift.js'; import jumpyClsTrace from '../../fixtures/traces/jumpy-cls-m90.json'; diff --git a/lighthouse-core/test/audits/metrics/experimental-interaction-to-next-paint-test.js b/lighthouse-core/test/audits/metrics/experimental-interaction-to-next-paint-test.js index 53c000f3d8e5..d83ed6053607 100644 --- a/lighthouse-core/test/audits/metrics/experimental-interaction-to-next-paint-test.js +++ b/lighthouse-core/test/audits/metrics/experimental-interaction-to-next-paint-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + const ExperimentalInteractionToNextPaint = require('../../../audits/metrics/experimental-interaction-to-next-paint.js'); diff --git a/lighthouse-core/test/audits/metrics/first-contentful-paint-3g-test.js b/lighthouse-core/test/audits/metrics/first-contentful-paint-3g-test.js index 4daad68ebcaa..8376547baff0 100644 --- a/lighthouse-core/test/audits/metrics/first-contentful-paint-3g-test.js +++ b/lighthouse-core/test/audits/metrics/first-contentful-paint-3g-test.js @@ -3,15 +3,15 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import FCP3G from '../../../audits/metrics/first-contentful-paint-3g.js'; -const options = FCP3G.defaultOptions; +import FCP3G from '../../../audits/metrics/first-contentful-paint-3g.js'; import pwaTrace from '../../fixtures/traces/progressive-app-m60.json'; import pwaDevtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; import {getURLArtifactFromDevtoolsLog} from '../../test-utils.js'; +const options = FCP3G.defaultOptions; + /* eslint-env jest */ describe('Performance: first-contentful-paint-3g audit', () => { diff --git a/lighthouse-core/test/audits/metrics/first-contentful-paint-test.js b/lighthouse-core/test/audits/metrics/first-contentful-paint-test.js index 0bd11b6edc9d..ce332ac6e490 100644 --- a/lighthouse-core/test/audits/metrics/first-contentful-paint-test.js +++ b/lighthouse-core/test/audits/metrics/first-contentful-paint-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import FcpAudit from '../../../audits/metrics/first-contentful-paint.js'; + import {strict as assert} from 'assert'; + +import FcpAudit from '../../../audits/metrics/first-contentful-paint.js'; const options = FcpAudit.defaultOptions; import constants from '../../../config/constants.js'; import pwaTrace from '../../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/audits/metrics/first-meaningful-paint-test.js b/lighthouse-core/test/audits/metrics/first-meaningful-paint-test.js index 448a1ec61a77..c5d329f6c980 100644 --- a/lighthouse-core/test/audits/metrics/first-meaningful-paint-test.js +++ b/lighthouse-core/test/audits/metrics/first-meaningful-paint-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import FMPAudit from '../../../audits/metrics/first-meaningful-paint.js'; import Audit from '../../../audits/audit.js'; import constants from '../../../config/constants.js'; -import {strict as assert} from 'assert'; import trace from '../../fixtures/traces/progressive-app-m60.json'; import devtoolsLogs from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; import {getURLArtifactFromDevtoolsLog} from '../../test-utils.js'; diff --git a/lighthouse-core/test/audits/metrics/interactive-test.js b/lighthouse-core/test/audits/metrics/interactive-test.js index 87d52401b6c9..946a367b57e6 100644 --- a/lighthouse-core/test/audits/metrics/interactive-test.js +++ b/lighthouse-core/test/audits/metrics/interactive-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Interactive from '../../../audits/metrics/interactive.js'; + import {strict as assert} from 'assert'; + +import Interactive from '../../../audits/metrics/interactive.js'; const options = Interactive.defaultOptions; import constants from '../../../config/constants.js'; import acceptableTrace from '../../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/audits/metrics/largest-contentful-paint-test.js b/lighthouse-core/test/audits/metrics/largest-contentful-paint-test.js index c7c3ba7d6fb0..3b903dfef70a 100644 --- a/lighthouse-core/test/audits/metrics/largest-contentful-paint-test.js +++ b/lighthouse-core/test/audits/metrics/largest-contentful-paint-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import LCPAudit from '../../../audits/metrics/largest-contentful-paint.js'; const defaultOptions = LCPAudit.defaultOptions; diff --git a/lighthouse-core/test/audits/metrics/speed-index-test.js b/lighthouse-core/test/audits/metrics/speed-index-test.js index 213c910e0925..df775acc2a78 100644 --- a/lighthouse-core/test/audits/metrics/speed-index-test.js +++ b/lighthouse-core/test/audits/metrics/speed-index-test.js @@ -3,18 +3,19 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -/* eslint-env jest */ -import Audit from '../../../audits/metrics/speed-index.js'; +/* eslint-env jest */ import {strict as assert} from 'assert'; -const options = Audit.defaultOptions; + +import Audit from '../../../audits/metrics/speed-index.js'; import constants from '../../../config/constants.js'; import pwaTrace from '../../fixtures/traces/progressive-app-m60.json'; import pwaDevtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; +const options = Audit.defaultOptions; + /** * @param {{ * {LH.SharedFlagsSettings['formFactor']} formFactor diff --git a/lighthouse-core/test/audits/metrics/total-blocking-time-test.js b/lighthouse-core/test/audits/metrics/total-blocking-time-test.js index f11fa7b69109..d993da0a69fc 100644 --- a/lighthouse-core/test/audits/metrics/total-blocking-time-test.js +++ b/lighthouse-core/test/audits/metrics/total-blocking-time-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import TBTAudit from '../../../audits/metrics/total-blocking-time.js'; import constants from '../../../config/constants.js'; diff --git a/lighthouse-core/test/audits/network-requests-test.js b/lighthouse-core/test/audits/network-requests-test.js index 36e699aaae6b..52c73116e827 100644 --- a/lighthouse-core/test/audits/network-requests-test.js +++ b/lighthouse-core/test/audits/network-requests-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import NetworkRequests from '../../audits/network-requests.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/network-rtt-test.js b/lighthouse-core/test/audits/network-rtt-test.js index beee5f703dc5..47ba3241fe0f 100644 --- a/lighthouse-core/test/audits/network-rtt-test.js +++ b/lighthouse-core/test/audits/network-rtt-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import NetworkRTT from '../../audits/network-rtt.js'; import acceptableDevToolsLog from '../fixtures/traces/progressive-app-m60.devtools.log.json'; diff --git a/lighthouse-core/test/audits/network-server-latency-test.js b/lighthouse-core/test/audits/network-server-latency-test.js index a6ac5fa8cbec..91cb517a7fd5 100644 --- a/lighthouse-core/test/audits/network-server-latency-test.js +++ b/lighthouse-core/test/audits/network-server-latency-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import ServerLatency from '../../audits/network-server-latency.js'; import acceptableDevToolsLog from '../fixtures/traces/progressive-app-m60.devtools.log.json'; diff --git a/lighthouse-core/test/audits/no-unload-listeners-test.js b/lighthouse-core/test/audits/no-unload-listeners-test.js index 341f33ca858f..90f0ed2b22cd 100644 --- a/lighthouse-core/test/audits/no-unload-listeners-test.js +++ b/lighthouse-core/test/audits/no-unload-listeners-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import NoUnloadListeners from '../../audits/no-unload-listeners.js'; import {createScript} from '../test-utils.js'; diff --git a/lighthouse-core/test/audits/non-composited-animations-test.js b/lighthouse-core/test/audits/non-composited-animations-test.js index f1c0b7892579..f895784b3798 100644 --- a/lighthouse-core/test/audits/non-composited-animations-test.js +++ b/lighthouse-core/test/audits/non-composited-animations-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import NonCompositedAnimationsAudit from '../../audits/non-composited-animations.js'; diff --git a/lighthouse-core/test/audits/performance-budget-test.js b/lighthouse-core/test/audits/performance-budget-test.js index 6bba2f3fe685..67f375d5ddf7 100644 --- a/lighthouse-core/test/audits/performance-budget-test.js +++ b/lighthouse-core/test/audits/performance-budget-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import ResourceBudgetAudit from '../../audits/performance-budget.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/predictive-perf-test.js b/lighthouse-core/test/audits/predictive-perf-test.js index 83db06a8b8a5..090ffad28b89 100644 --- a/lighthouse-core/test/audits/predictive-perf-test.js +++ b/lighthouse-core/test/audits/predictive-perf-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import PredictivePerf from '../../audits/predictive-perf.js'; import acceptableTrace from '../fixtures/traces/lcp-m78.json'; diff --git a/lighthouse-core/test/audits/preload-fonts-test.js b/lighthouse-core/test/audits/preload-fonts-test.js index 88598de3a881..beb9105eb329 100644 --- a/lighthouse-core/test/audits/preload-fonts-test.js +++ b/lighthouse-core/test/audits/preload-fonts-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import PreloadFontsAudit from '../../audits/preload-fonts.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/preload-lcp-image-test.js b/lighthouse-core/test/audits/preload-lcp-image-test.js index 8db32d1e355f..57b14924255c 100644 --- a/lighthouse-core/test/audits/preload-lcp-image-test.js +++ b/lighthouse-core/test/audits/preload-lcp-image-test.js @@ -4,12 +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. */ -'use strict'; /* eslint-env jest */ import PreloadLCPImage from '../../audits/preload-lcp-image.js'; - import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; import createTestTrace from '../create-test-trace.js'; diff --git a/lighthouse-core/test/audits/redirects-test.js b/lighthouse-core/test/audits/redirects-test.js index 5404588185a3..8e48b9a91760 100644 --- a/lighthouse-core/test/audits/redirects-test.js +++ b/lighthouse-core/test/audits/redirects-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import RedirectsAudit from '../../audits/redirects.js'; + import {strict as assert} from 'assert'; + +import RedirectsAudit from '../../audits/redirects.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; import createTestTrace from '../create-test-trace.js'; diff --git a/lighthouse-core/test/audits/resource-summary-test.js b/lighthouse-core/test/audits/resource-summary-test.js index e12768bbc747..2ccc042e0fc3 100644 --- a/lighthouse-core/test/audits/resource-summary-test.js +++ b/lighthouse-core/test/audits/resource-summary-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import ResourceSummaryAudit from '../../audits/resource-summary.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/screenshot-thumbnails-test.js b/lighthouse-core/test/audits/screenshot-thumbnails-test.js index 6670927e3c12..89f27aca96a8 100644 --- a/lighthouse-core/test/audits/screenshot-thumbnails-test.js +++ b/lighthouse-core/test/audits/screenshot-thumbnails-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import fs from 'fs'; import path from 'path'; import {strict as assert} from 'assert'; + import ScreenshotThumbnailsAudit from '../../audits/screenshot-thumbnails.js'; import pwaTrace from '../fixtures/traces/progressive-app-m60.json'; const noScreenshotsTrace = {traceEvents: pwaTrace.traceEvents.filter(e => e.name !== 'Screenshot')}; diff --git a/lighthouse-core/test/audits/script-treemap-data-test.js b/lighthouse-core/test/audits/script-treemap-data-test.js index 5fd4e25177dc..e20056abae99 100644 --- a/lighthouse-core/test/audits/script-treemap-data-test.js +++ b/lighthouse-core/test/audits/script-treemap-data-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import ScriptTreemapData_ from '../../audits/script-treemap-data.js'; - import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; import { createScript, diff --git a/lighthouse-core/test/audits/seo/canonical-test.js b/lighthouse-core/test/audits/seo/canonical-test.js index 82df1cdc3749..a68dbca1410e 100644 --- a/lighthouse-core/test/audits/seo/canonical-test.js +++ b/lighthouse-core/test/audits/seo/canonical-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import CanonicalAudit from '../../../audits/seo/canonical.js'; + import {strict as assert} from 'assert'; + +import CanonicalAudit from '../../../audits/seo/canonical.js'; import networkRecordsToDevtoolsLog from '../../network-records-to-devtools-log.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/seo/crawlable-anchors-test.js b/lighthouse-core/test/audits/seo/crawlable-anchors-test.js index dd8bd57bd058..3ff38a22dbbf 100644 --- a/lighthouse-core/test/audits/seo/crawlable-anchors-test.js +++ b/lighthouse-core/test/audits/seo/crawlable-anchors-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import assert from 'assert'; + import CrawlableAnchorsAudit from '../../../audits/seo/crawlable-anchors.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/seo/font-size-test.js b/lighthouse-core/test/audits/seo/font-size-test.js index 7300cd39a146..0afe0f1d5d88 100644 --- a/lighthouse-core/test/audits/seo/font-size-test.js +++ b/lighthouse-core/test/audits/seo/font-size-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import FontSizeAudit from '../../../audits/seo/font-size.js'; import constants from '../../../config/constants.js'; -import {strict as assert} from 'assert'; const URL = { requestedUrl: 'https://example.com', diff --git a/lighthouse-core/test/audits/seo/hreflang-test.js b/lighthouse-core/test/audits/seo/hreflang-test.js index 52965397ae0a..77ef9af450d6 100644 --- a/lighthouse-core/test/audits/seo/hreflang-test.js +++ b/lighthouse-core/test/audits/seo/hreflang-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import HreflangAudit from '../../../audits/seo/hreflang.js'; const node = {}; diff --git a/lighthouse-core/test/audits/seo/http-status-code-test.js b/lighthouse-core/test/audits/seo/http-status-code-test.js index fef473432b17..bdf54e8c4b2e 100644 --- a/lighthouse-core/test/audits/seo/http-status-code-test.js +++ b/lighthouse-core/test/audits/seo/http-status-code-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import HTTPStatusCodeAudit from '../../../audits/seo/http-status-code.js'; + import {strict as assert} from 'assert'; + +import HTTPStatusCodeAudit from '../../../audits/seo/http-status-code.js'; import networkRecordsToDevtoolsLog from '../../network-records-to-devtools-log.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/seo/is-crawlable-test.js b/lighthouse-core/test/audits/seo/is-crawlable-test.js index f371eecb35e6..460bb24255be 100644 --- a/lighthouse-core/test/audits/seo/is-crawlable-test.js +++ b/lighthouse-core/test/audits/seo/is-crawlable-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import IsCrawlableAudit from '../../../audits/seo/is-crawlable.js'; + import {strict as assert} from 'assert'; + +import IsCrawlableAudit from '../../../audits/seo/is-crawlable.js'; import networkRecordsToDevtoolsLog from '../../network-records-to-devtools-log.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/seo/link-text-test.js b/lighthouse-core/test/audits/seo/link-text-test.js index b6132e175c4d..9d95ceef0cd3 100644 --- a/lighthouse-core/test/audits/seo/link-text-test.js +++ b/lighthouse-core/test/audits/seo/link-text-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import LinkTextAudit from '../../../audits/seo/link-text.js'; + import {strict as assert} from 'assert'; +import LinkTextAudit from '../../../audits/seo/link-text.js'; + /* eslint-env jest */ describe('SEO: link text audit', () => { diff --git a/lighthouse-core/test/audits/seo/meta-description-test.js b/lighthouse-core/test/audits/seo/meta-description-test.js index f9f175361f28..26d361dd8029 100644 --- a/lighthouse-core/test/audits/seo/meta-description-test.js +++ b/lighthouse-core/test/audits/seo/meta-description-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../../audits/seo/meta-description.js'; + import {strict as assert} from 'assert'; +import Audit from '../../../audits/seo/meta-description.js'; + /* eslint-env jest */ describe('SEO: description audit', () => { diff --git a/lighthouse-core/test/audits/seo/plugins-test.js b/lighthouse-core/test/audits/seo/plugins-test.js index d061f9b81416..7bdf9068d93a 100644 --- a/lighthouse-core/test/audits/seo/plugins-test.js +++ b/lighthouse-core/test/audits/seo/plugins-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import PluginsAudit from '../../../audits/seo/plugins.js'; + import {strict as assert} from 'assert'; +import PluginsAudit from '../../../audits/seo/plugins.js'; + /* eslint-env jest */ describe('SEO: Avoids plugins', () => { diff --git a/lighthouse-core/test/audits/seo/robots-txt-test.js b/lighthouse-core/test/audits/seo/robots-txt-test.js index 8459dbb6f154..df3584a1a15a 100644 --- a/lighthouse-core/test/audits/seo/robots-txt-test.js +++ b/lighthouse-core/test/audits/seo/robots-txt-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import RobotsTxtAudit from '../../../audits/seo/robots-txt.js'; + import {strict as assert} from 'assert'; +import RobotsTxtAudit from '../../../audits/seo/robots-txt.js'; + /* eslint-env jest */ describe('SEO: robots.txt audit', () => { diff --git a/lighthouse-core/test/audits/seo/tap-targets-test.js b/lighthouse-core/test/audits/seo/tap-targets-test.js index cc04e89d7a9f..21f2fa607cca 100644 --- a/lighthouse-core/test/audits/seo/tap-targets-test.js +++ b/lighthouse-core/test/audits/seo/tap-targets-test.js @@ -3,14 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import TapTargetsAudit from '../../../audits/seo/tap-targets.js'; +import {strict as assert} from 'assert'; +import TapTargetsAudit from '../../../audits/seo/tap-targets.js'; import constants from '../../../config/constants.js'; -import {strict as assert} from 'assert'; /** @param {LH.SharedFlagsSettings['formFactor']} formFactor */ const getFakeContext = (formFactor = 'mobile') => ({ diff --git a/lighthouse-core/test/audits/server-response-time-test.js b/lighthouse-core/test/audits/server-response-time-test.js index 311629163d9f..4843380332e4 100644 --- a/lighthouse-core/test/audits/server-response-time-test.js +++ b/lighthouse-core/test/audits/server-response-time-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import ServerResponseTime from '../../audits/server-response-time.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/service-worker-test.js b/lighthouse-core/test/audits/service-worker-test.js index 3ab724a52949..b7835d4e0375 100644 --- a/lighthouse-core/test/audits/service-worker-test.js +++ b/lighthouse-core/test/audits/service-worker-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import ServiceWorker from '../../audits/service-worker.js'; import URL from '../../lib/url-shim.js'; import manifestParser from '../../lib/manifest-parser.js'; -import {strict as assert} from 'assert'; /* eslint-env jest */ diff --git a/lighthouse-core/test/audits/splash-screen-test.js b/lighthouse-core/test/audits/splash-screen-test.js index 694269011659..e5748523158b 100644 --- a/lighthouse-core/test/audits/splash-screen-test.js +++ b/lighthouse-core/test/audits/splash-screen-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import SplashScreenAudit from '../../audits/splash-screen.js'; import manifestParser from '../../lib/manifest-parser.js'; import manifest from '../fixtures/manifest.json'; diff --git a/lighthouse-core/test/audits/themed-omnibox-test.js b/lighthouse-core/test/audits/themed-omnibox-test.js index e0e8118d3838..983a189afdbf 100644 --- a/lighthouse-core/test/audits/themed-omnibox-test.js +++ b/lighthouse-core/test/audits/themed-omnibox-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import ThemedOmniboxAudit from '../../audits/themed-omnibox.js'; + import {strict as assert} from 'assert'; + +import ThemedOmniboxAudit from '../../audits/themed-omnibox.js'; import manifestParser from '../../lib/manifest-parser.js'; import manifest from '../fixtures/manifest.json'; diff --git a/lighthouse-core/test/audits/third-party-facades-test.js b/lighthouse-core/test/audits/third-party-facades-test.js index 3ff1266f4a68..165c0e15ed40 100644 --- a/lighthouse-core/test/audits/third-party-facades-test.js +++ b/lighthouse-core/test/audits/third-party-facades-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import ThirdPartyFacades from '../../audits/third-party-facades.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/third-party-summary-test.js b/lighthouse-core/test/audits/third-party-summary-test.js index 5fdca554082b..66e9abe40c5a 100644 --- a/lighthouse-core/test/audits/third-party-summary-test.js +++ b/lighthouse-core/test/audits/third-party-summary-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import ThirdPartySummary from '../../audits/third-party-summary.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/timing-budget-test.js b/lighthouse-core/test/audits/timing-budget-test.js index 19ffd7a1b731..eb5b257f937b 100644 --- a/lighthouse-core/test/audits/timing-budget-test.js +++ b/lighthouse-core/test/audits/timing-budget-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import TimingBudgetAudit from '../../audits/timing-budget.js'; import trace from '../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/audits/unsized-images-test.js b/lighthouse-core/test/audits/unsized-images-test.js index 41f1333cfa27..741b06090276 100644 --- a/lighthouse-core/test/audits/unsized-images-test.js +++ b/lighthouse-core/test/audits/unsized-images-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import UnsizedImagesAudit from '../../audits/unsized-images.js'; diff --git a/lighthouse-core/test/audits/user-timing-test.js b/lighthouse-core/test/audits/user-timing-test.js index 0245534733f6..9c21c9f0c60f 100644 --- a/lighthouse-core/test/audits/user-timing-test.js +++ b/lighthouse-core/test/audits/user-timing-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import UserTimingsAudit from '../../audits/user-timings.js'; + import {strict as assert} from 'assert'; + +import UserTimingsAudit from '../../audits/user-timings.js'; import traceEvents from '../fixtures/traces/trace-user-timings.json'; function generateArtifactsWithTrace(trace) { diff --git a/lighthouse-core/test/audits/uses-rel-preconnect-test.js b/lighthouse-core/test/audits/uses-rel-preconnect-test.js index a5a4ea1ef3f7..2f8da8d73a45 100644 --- a/lighthouse-core/test/audits/uses-rel-preconnect-test.js +++ b/lighthouse-core/test/audits/uses-rel-preconnect-test.js @@ -4,13 +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. */ -'use strict'; /* eslint-env jest */ -import UsesRelPreconnect from '../../audits/uses-rel-preconnect.js'; - import {strict as assert} from 'assert'; + +import UsesRelPreconnect from '../../audits/uses-rel-preconnect.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; import createTestTrace from '../create-test-trace.js'; diff --git a/lighthouse-core/test/audits/uses-rel-preload-test.js b/lighthouse-core/test/audits/uses-rel-preload-test.js index 695c4ef06665..507258448ead 100644 --- a/lighthouse-core/test/audits/uses-rel-preload-test.js +++ b/lighthouse-core/test/audits/uses-rel-preload-test.js @@ -4,13 +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. */ -'use strict'; /* eslint-env jest */ -import UsesRelPreload from '../../audits/uses-rel-preload.js'; - import {strict as assert} from 'assert'; + +import UsesRelPreload from '../../audits/uses-rel-preload.js'; import pwaTrace from '../fixtures/traces/progressive-app-m60.json'; import pwaDevtoolsLog from '../fixtures/traces/progressive-app-m60.devtools.log.json'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/audits/valid-source-maps-test.js b/lighthouse-core/test/audits/valid-source-maps-test.js index 20dd258ca58e..a4b7a6b2ae26 100644 --- a/lighthouse-core/test/audits/valid-source-maps-test.js +++ b/lighthouse-core/test/audits/valid-source-maps-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {createScript, loadSourceMapFixture} from '../test-utils.js'; - import ValidSourceMaps from '../../audits/valid-source-maps.js'; const largeBundle = loadSourceMapFixture('coursehero-bundle-1'); const smallBundle = loadSourceMapFixture('coursehero-bundle-2'); diff --git a/lighthouse-core/test/audits/viewport-test.js b/lighthouse-core/test/audits/viewport-test.js index e8ec576e1525..c447568b2696 100644 --- a/lighthouse-core/test/audits/viewport-test.js +++ b/lighthouse-core/test/audits/viewport-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Audit from '../../audits/viewport.js'; + import {strict as assert} from 'assert'; +import Audit from '../../audits/viewport.js'; + /* eslint-env jest */ describe('Mobile-friendly: viewport audit', () => { diff --git a/lighthouse-core/test/computed/computed-artifact-test.js b/lighthouse-core/test/computed/computed-artifact-test.js index d0c94dc8be17..7e8889421691 100644 --- a/lighthouse-core/test/computed/computed-artifact-test.js +++ b/lighthouse-core/test/computed/computed-artifact-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/critical-request-chains-test.js b/lighthouse-core/test/computed/critical-request-chains-test.js index c1101dbd008f..8228340a04ec 100644 --- a/lighthouse-core/test/computed/critical-request-chains-test.js +++ b/lighthouse-core/test/computed/critical-request-chains-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/image-records-test.js b/lighthouse-core/test/computed/image-records-test.js index e726ae6295f7..87f3f6ca6599 100644 --- a/lighthouse-core/test/computed/image-records-test.js +++ b/lighthouse-core/test/computed/image-records-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import ImageRecords from '../../computed/image-records.js'; - import NetworkRequest from '../../lib/network-request.js'; /** diff --git a/lighthouse-core/test/computed/js-bundles-test.js b/lighthouse-core/test/computed/js-bundles-test.js index d30f81a3bca0..da9498e491f7 100644 --- a/lighthouse-core/test/computed/js-bundles-test.js +++ b/lighthouse-core/test/computed/js-bundles-test.js @@ -3,11 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import JsBundles from '../../computed/js-bundles.js'; - import {createScript, loadSourceMapFixture} from '../test-utils.js'; describe('JsBundles computed artifact', () => { diff --git a/lighthouse-core/test/computed/load-simulator-test.js b/lighthouse-core/test/computed/load-simulator-test.js index 3ec2789a829c..f49ac059fc3f 100644 --- a/lighthouse-core/test/computed/load-simulator-test.js +++ b/lighthouse-core/test/computed/load-simulator-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/main-resource-test.js b/lighthouse-core/test/computed/main-resource-test.js index 42ecd187c52f..156785264056 100644 --- a/lighthouse-core/test/computed/main-resource-test.js +++ b/lighthouse-core/test/computed/main-resource-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/main-thread-tasks-test.js b/lighthouse-core/test/computed/main-thread-tasks-test.js index bfc91fde7e03..2c3d5f94531a 100644 --- a/lighthouse-core/test/computed/main-thread-tasks-test.js +++ b/lighthouse-core/test/computed/main-thread-tasks-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import MainThreadTasks from '../../computed/main-thread-tasks.js'; - import pwaTrace from '../fixtures/traces/progressive-app-m60.json'; describe('MainThreadTasksComputed', () => { diff --git a/lighthouse-core/test/computed/manifest-values-test.js b/lighthouse-core/test/computed/manifest-values-test.js index 256d2f91a546..be885e9b8512 100644 --- a/lighthouse-core/test/computed/manifest-values-test.js +++ b/lighthouse-core/test/computed/manifest-values-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/metrics/cumulative-layout-shift-test.js b/lighthouse-core/test/computed/metrics/cumulative-layout-shift-test.js index 9aa203ab5f88..7d0c94776934 100644 --- a/lighthouse-core/test/computed/metrics/cumulative-layout-shift-test.js +++ b/lighthouse-core/test/computed/metrics/cumulative-layout-shift-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/metrics/first-contentful-paint-all-frames-test.js b/lighthouse-core/test/computed/metrics/first-contentful-paint-all-frames-test.js index 2f49b3d26964..3188f979c30e 100644 --- a/lighthouse-core/test/computed/metrics/first-contentful-paint-all-frames-test.js +++ b/lighthouse-core/test/computed/metrics/first-contentful-paint-all-frames-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import FirstContentfulPaintAllFrames from '../../../computed/metrics/first-contentful-paint-all-frames.js'; // eslint-disable-line max-len import FirstContentfulPaint from '../../../computed/metrics/first-contentful-paint.js'; // eslint-disable-line max-len diff --git a/lighthouse-core/test/computed/metrics/first-contentful-paint-test.js b/lighthouse-core/test/computed/metrics/first-contentful-paint-test.js index f14f0085ec16..d4e347239e9c 100644 --- a/lighthouse-core/test/computed/metrics/first-contentful-paint-test.js +++ b/lighthouse-core/test/computed/metrics/first-contentful-paint-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import FirstContentfulPaint from '../../../computed/metrics/first-contentful-paint.js'; // eslint-disable-line max-len import trace from '../../fixtures/traces/progressive-app-m60.json'; import devtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; diff --git a/lighthouse-core/test/computed/metrics/first-meaningful-paint-test.js b/lighthouse-core/test/computed/metrics/first-meaningful-paint-test.js index 9be382d0655c..2b121a2bd612 100644 --- a/lighthouse-core/test/computed/metrics/first-meaningful-paint-test.js +++ b/lighthouse-core/test/computed/metrics/first-meaningful-paint-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import FirstMeaningfulPaint from '../../../computed/metrics/first-meaningful-paint.js'; import {strict as assert} from 'assert'; + +import FirstMeaningfulPaint from '../../../computed/metrics/first-meaningful-paint.js'; import {getURLArtifactFromDevtoolsLog} from '../../test-utils.js'; import pwaTrace from '../../fixtures/traces/progressive-app-m60.json'; import pwaDevtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; diff --git a/lighthouse-core/test/computed/metrics/interactive-test.js b/lighthouse-core/test/computed/metrics/interactive-test.js index 8e411a61a927..559b46b8bcfe 100644 --- a/lighthouse-core/test/computed/metrics/interactive-test.js +++ b/lighthouse-core/test/computed/metrics/interactive-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Interactive from '../../../computed/metrics/interactive.js'; + import {strict as assert} from 'assert'; + +import Interactive from '../../../computed/metrics/interactive.js'; import trace from '../../fixtures/traces/progressive-app-m60.json'; import devtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; import {getURLArtifactFromDevtoolsLog} from '../../test-utils.js'; diff --git a/lighthouse-core/test/computed/metrics/lantern-first-contentful-paint-test.js b/lighthouse-core/test/computed/metrics/lantern-first-contentful-paint-test.js index 11869559254a..de1ec0f42c46 100644 --- a/lighthouse-core/test/computed/metrics/lantern-first-contentful-paint-test.js +++ b/lighthouse-core/test/computed/metrics/lantern-first-contentful-paint-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import LanternFirstContentfulPaint from '../../../computed/metrics/lantern-first-contentful-paint.js'; // eslint-disable-line max-len + import {strict as assert} from 'assert'; + +import LanternFirstContentfulPaint from '../../../computed/metrics/lantern-first-contentful-paint.js'; // eslint-disable-line max-len import trace from '../../fixtures/traces/progressive-app-m60.json'; import devtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; import {getURLArtifactFromDevtoolsLog} from '../../test-utils.js'; diff --git a/lighthouse-core/test/computed/metrics/lantern-first-meaningful-paint-test.js b/lighthouse-core/test/computed/metrics/lantern-first-meaningful-paint-test.js index 70e313b43943..75c2c4186b88 100644 --- a/lighthouse-core/test/computed/metrics/lantern-first-meaningful-paint-test.js +++ b/lighthouse-core/test/computed/metrics/lantern-first-meaningful-paint-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import trace from '../../fixtures/traces/progressive-app-m60.json'; import devtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; import LanternFirstMeaningfulPaint from diff --git a/lighthouse-core/test/computed/metrics/lantern-interactive-test.js b/lighthouse-core/test/computed/metrics/lantern-interactive-test.js index dde80ee7ba71..a74a691c301f 100644 --- a/lighthouse-core/test/computed/metrics/lantern-interactive-test.js +++ b/lighthouse-core/test/computed/metrics/lantern-interactive-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import LanternInteractive from '../../../computed/metrics/lantern-interactive.js'; + import {strict as assert} from 'assert'; + +import LanternInteractive from '../../../computed/metrics/lantern-interactive.js'; import trace from '../../fixtures/traces/progressive-app-m60.json'; import devtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; import iframeTrace from '../../fixtures/traces/iframe-m79.trace.json'; diff --git a/lighthouse-core/test/computed/metrics/lantern-largest-contentful-paint-test.js b/lighthouse-core/test/computed/metrics/lantern-largest-contentful-paint-test.js index 92ac78ebba70..bc7030c4617e 100644 --- a/lighthouse-core/test/computed/metrics/lantern-largest-contentful-paint-test.js +++ b/lighthouse-core/test/computed/metrics/lantern-largest-contentful-paint-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import trace from '../../fixtures/traces/lcp-m78.json'; import devtoolsLog from '../../fixtures/traces/lcp-m78.devtools.log.json'; import LanternLargestContentfulPaint from '../../../computed/metrics/lantern-largest-contentful-paint.js'; // eslint-disable-line max-len diff --git a/lighthouse-core/test/computed/metrics/lantern-speed-index-test.js b/lighthouse-core/test/computed/metrics/lantern-speed-index-test.js index 60ff7b72fc63..b25b8cdfa15a 100644 --- a/lighthouse-core/test/computed/metrics/lantern-speed-index-test.js +++ b/lighthouse-core/test/computed/metrics/lantern-speed-index-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import constants from '../../../config/constants.js'; import LanternSpeedIndex from '../../../computed/metrics/lantern-speed-index.js'; diff --git a/lighthouse-core/test/computed/metrics/largest-contentful-paint-all-frames-test.js b/lighthouse-core/test/computed/metrics/largest-contentful-paint-all-frames-test.js index 684287129e46..c63fb628ffd1 100644 --- a/lighthouse-core/test/computed/metrics/largest-contentful-paint-all-frames-test.js +++ b/lighthouse-core/test/computed/metrics/largest-contentful-paint-all-frames-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import LargestContentfulPaintAllFrames from '../../../computed/metrics/largest-contentful-paint-all-frames.js'; // eslint-disable-line max-len import traceAllFrames from '../../fixtures/traces/frame-metrics-m89.json'; import devtoolsLogAllFrames from '../../fixtures/traces/frame-metrics-m89.devtools.log.json'; diff --git a/lighthouse-core/test/computed/metrics/largest-contentful-paint-test.js b/lighthouse-core/test/computed/metrics/largest-contentful-paint-test.js index d9224192cb35..eabc1b9077ff 100644 --- a/lighthouse-core/test/computed/metrics/largest-contentful-paint-test.js +++ b/lighthouse-core/test/computed/metrics/largest-contentful-paint-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import LargestContentfulPaint from '../../../computed/metrics/largest-contentful-paint.js'; // eslint-disable-line max-len import trace from '../../fixtures/traces/lcp-m78.json'; import devtoolsLog from '../../fixtures/traces/lcp-m78.devtools.log.json'; diff --git a/lighthouse-core/test/computed/metrics/max-potential-fid-test.js b/lighthouse-core/test/computed/metrics/max-potential-fid-test.js index 455b887aa3bb..77062ec86a10 100644 --- a/lighthouse-core/test/computed/metrics/max-potential-fid-test.js +++ b/lighthouse-core/test/computed/metrics/max-potential-fid-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import MaxPotentialFID from '../../../computed/metrics/max-potential-fid.js'; import trace from '../../fixtures/traces/progressive-app-m60.json'; import devtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; diff --git a/lighthouse-core/test/computed/metrics/responsiveness-test.js b/lighthouse-core/test/computed/metrics/responsiveness-test.js index 93aaace17901..c4b63ca3b0df 100644 --- a/lighthouse-core/test/computed/metrics/responsiveness-test.js +++ b/lighthouse-core/test/computed/metrics/responsiveness-test.js @@ -3,13 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + const assert = require('assert').strict; const Responsiveness = require('../../../computed/metrics/responsiveness.js'); const createTestTrace = require('../../create-test-trace.js'); - const interactionTrace = require('../../fixtures/traces/timespan-responsiveness-m103.trace.json'); const noInteractionTrace = require('../../fixtures/traces/frame-metrics-m89.json'); diff --git a/lighthouse-core/test/computed/metrics/speed-index-test.js b/lighthouse-core/test/computed/metrics/speed-index-test.js index 9683f285bf4b..10db39355e37 100644 --- a/lighthouse-core/test/computed/metrics/speed-index-test.js +++ b/lighthouse-core/test/computed/metrics/speed-index-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import SpeedIndex from '../../../computed/metrics/speed-index.js'; import trace from '../../fixtures/traces/progressive-app-m60.json'; import devtoolsLog from '../../fixtures/traces/progressive-app-m60.devtools.log.json'; diff --git a/lighthouse-core/test/computed/metrics/timing-summary-test.js b/lighthouse-core/test/computed/metrics/timing-summary-test.js index b0353aa64f33..e3785f34cfe5 100644 --- a/lighthouse-core/test/computed/metrics/timing-summary-test.js +++ b/lighthouse-core/test/computed/metrics/timing-summary-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import TimingSummary from '../../../computed/metrics/timing-summary.js'; import trace from '../../fixtures/traces/frame-metrics-m90.json'; diff --git a/lighthouse-core/test/computed/metrics/total-blocking-time-test.js b/lighthouse-core/test/computed/metrics/total-blocking-time-test.js index d9eb82a6a259..282cbc8aa48f 100644 --- a/lighthouse-core/test/computed/metrics/total-blocking-time-test.js +++ b/lighthouse-core/test/computed/metrics/total-blocking-time-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import TotalBlockingTime from '../../../computed/metrics/total-blocking-time.js'; import trace from '../../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/computed/module-duplication-test.js b/lighthouse-core/test/computed/module-duplication-test.js index 3f9fc9c5558b..a10cd83a576c 100644 --- a/lighthouse-core/test/computed/module-duplication-test.js +++ b/lighthouse-core/test/computed/module-duplication-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import ModuleDuplication from '../../computed/module-duplication.js'; - import {createScript, loadSourceMapFixture} from '../test-utils.js'; describe('ModuleDuplication computed artifact', () => { diff --git a/lighthouse-core/test/computed/network-analysis-test.js b/lighthouse-core/test/computed/network-analysis-test.js index d4edf2ac54cf..dcfc70fac92f 100644 --- a/lighthouse-core/test/computed/network-analysis-test.js +++ b/lighthouse-core/test/computed/network-analysis-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import NetworkAnalysis from '../../computed/network-analysis.js'; import acceptableDevToolsLog from '../fixtures/traces/progressive-app-m60.devtools.log.json'; diff --git a/lighthouse-core/test/computed/page-dependency-graph-test.js b/lighthouse-core/test/computed/page-dependency-graph-test.js index dbeb024bf6b5..d49ea0796d2e 100644 --- a/lighthouse-core/test/computed/page-dependency-graph-test.js +++ b/lighthouse-core/test/computed/page-dependency-graph-test.js @@ -3,14 +3,15 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import PageDependencyGraph from '../../computed/page-dependency-graph.js'; import BaseNode from '../../lib/dependency-graph/base-node.js'; import NetworkRequest from '../../lib/network-request.js'; import sampleTrace from '../fixtures/traces/iframe-m79.trace.json'; import sampleDevtoolsLog from '../fixtures/traces/iframe-m79.devtoolslog.json'; -import {strict as assert} from 'assert'; import {getURLArtifactFromDevtoolsLog} from '../test-utils.js'; import NetworkRecorder from '../../lib/network-recorder.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; diff --git a/lighthouse-core/test/computed/processed-navigation-test.js b/lighthouse-core/test/computed/processed-navigation-test.js index b96065cbe0f3..420a00839080 100644 --- a/lighthouse-core/test/computed/processed-navigation-test.js +++ b/lighthouse-core/test/computed/processed-navigation-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import ProcessedTrace from '../../computed/processed-trace.js'; - import ProcessedNavigation from '../../computed/processed-navigation.js'; import pwaTrace from '../fixtures/traces/progressive-app-m60.json'; import noFCPtrace from '../fixtures/traces/airhorner_no_fcp.json'; diff --git a/lighthouse-core/test/computed/processed-trace-test.js b/lighthouse-core/test/computed/processed-trace-test.js index 9eb0c3d66b39..f31653042423 100644 --- a/lighthouse-core/test/computed/processed-trace-test.js +++ b/lighthouse-core/test/computed/processed-trace-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import ProcessedTrace from '../../computed/processed-trace.js'; - import pwaTrace from '../fixtures/traces/progressive-app-m60.json'; describe('ProcessedTrace', () => { diff --git a/lighthouse-core/test/computed/resource-summary-test.js b/lighthouse-core/test/computed/resource-summary-test.js index 722a32c4b037..446aa3af8279 100644 --- a/lighthouse-core/test/computed/resource-summary-test.js +++ b/lighthouse-core/test/computed/resource-summary-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import ComputedResourceSummary from '../../computed/resource-summary.js'; + import {strict as assert} from 'assert'; + +import ComputedResourceSummary from '../../computed/resource-summary.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/screenshots-test.js b/lighthouse-core/test/computed/screenshots-test.js index 804b3dd06e7b..43004eb9ba12 100644 --- a/lighthouse-core/test/computed/screenshots-test.js +++ b/lighthouse-core/test/computed/screenshots-test.js @@ -3,12 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -/* eslint-env jest */ -import Screenshots from '../../computed/screenshots.js'; +/* eslint-env jest */ import {strict as assert} from 'assert'; + +import Screenshots from '../../computed/screenshots.js'; import pwaTrace from '../fixtures/traces/progressive-app.json'; describe('Screenshot computed artifact', () => { diff --git a/lighthouse-core/test/computed/speedline-test.js b/lighthouse-core/test/computed/speedline-test.js index aeaf6863df3c..1858830b121c 100644 --- a/lighthouse-core/test/computed/speedline-test.js +++ b/lighthouse-core/test/computed/speedline-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/trace-of-tab-test.js b/lighthouse-core/test/computed/trace-of-tab-test.js index 95bbb2e8ff49..b56dc8fdf6c8 100644 --- a/lighthouse-core/test/computed/trace-of-tab-test.js +++ b/lighthouse-core/test/computed/trace-of-tab-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import TraceOfTab from '../../computed/trace-of-tab.js'; - import pwaTrace from '../fixtures/traces/progressive-app-m60.json'; describe('TraceOfTab', () => { diff --git a/lighthouse-core/test/computed/unused-css-test.js b/lighthouse-core/test/computed/unused-css-test.js index b59d36316e77..e30e6030eb83 100644 --- a/lighthouse-core/test/computed/unused-css-test.js +++ b/lighthouse-core/test/computed/unused-css-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/unused-javascript-summary-test.js b/lighthouse-core/test/computed/unused-javascript-summary-test.js index a9d76a27b0cb..172760412fe3 100644 --- a/lighthouse-core/test/computed/unused-javascript-summary-test.js +++ b/lighthouse-core/test/computed/unused-javascript-summary-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import assert from 'assert'; + import UnusedJavaScriptSummary from '../../computed/unused-javascript-summary.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/computed/viewport-meta-test.js b/lighthouse-core/test/computed/viewport-meta-test.js index e2bf68fe21f7..c471d4b86290 100644 --- a/lighthouse-core/test/computed/viewport-meta-test.js +++ b/lighthouse-core/test/computed/viewport-meta-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/config/budget-test.js b/lighthouse-core/test/config/budget-test.js index 832dd74f499f..40aded28d140 100644 --- a/lighthouse-core/test/config/budget-test.js +++ b/lighthouse-core/test/config/budget-test.js @@ -3,13 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import Budget from '../../config/budget.js'; import {strict as assert} from 'assert'; +import Budget from '../../config/budget.js'; + describe('Budget', () => { let budgets; beforeEach(() => { diff --git a/lighthouse-core/test/config/config-helpers-test.js b/lighthouse-core/test/config/config-helpers-test.js index f2f3eced73a9..61c402b9fd5a 100644 --- a/lighthouse-core/test/config/config-helpers-test.js +++ b/lighthouse-core/test/config/config-helpers-test.js @@ -3,13 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import {jest} from '@jest/globals'; import path from 'path'; +import {jest} from '@jest/globals'; + import { deepClone, deepCloneConfigJson, diff --git a/lighthouse-core/test/config/config-plugin-test.js b/lighthouse-core/test/config/config-plugin-test.js index ca1c4fc03692..bf790f06a6b2 100644 --- a/lighthouse-core/test/config/config-plugin-test.js +++ b/lighthouse-core/test/config/config-plugin-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {strict as assert} from 'assert'; + import ConfigPlugin from '../../config/config-plugin.js'; import i18n from '../../lib/i18n/i18n.js'; import {createCommonjsRefs} from '../../scripts/esm-utils.js'; diff --git a/lighthouse-core/test/config/config-test.js b/lighthouse-core/test/config/config-test.js index 6a8f84ccf3c8..e83002cdb834 100644 --- a/lighthouse-core/test/config/config-test.js +++ b/lighthouse-core/test/config/config-test.js @@ -3,16 +3,18 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import Config from '../../config/config.js'; import {strict as assert} from 'assert'; import path from 'path'; + +import log from 'lighthouse-logger'; + +import Config from '../../config/config.js'; import defaultConfig from '../../config/default-config.js'; import constants from '../../config/constants.js'; -import log from 'lighthouse-logger'; import Gatherer from '../../gather/gatherers/gatherer.js'; import Audit from '../../audits/audit.js'; import i18n from '../../lib/i18n/i18n.js'; diff --git a/lighthouse-core/test/config/default-config-test.js b/lighthouse-core/test/config/default-config-test.js index b9ed68784b6e..827b3909e1f2 100644 --- a/lighthouse-core/test/config/default-config-test.js +++ b/lighthouse-core/test/config/default-config-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {strict as assert} from 'assert'; + import defaultConfig from '../../config/default-config.js'; describe('Default Config', () => { diff --git a/lighthouse-core/test/create-test-trace.js b/lighthouse-core/test/create-test-trace.js index cdbf434b8af2..7b085da75477 100644 --- a/lighthouse-core/test/create-test-trace.js +++ b/lighthouse-core/test/create-test-trace.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + const pid = 1111; const tid = 222; diff --git a/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-no-category/plugin-no-category.js b/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-no-category/plugin-no-category.js index cf9b41de14aa..917619b2633d 100644 --- a/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-no-category/plugin-no-category.js +++ b/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-no-category/plugin-no-category.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /** @type {LH.Config.Plugin} */ module.exports = { diff --git a/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-no-groups/plugin-no-groups.js b/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-no-groups/plugin-no-groups.js index fef0010ddb50..c0a37d702702 100644 --- a/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-no-groups/plugin-no-groups.js +++ b/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-no-groups/plugin-no-groups.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /** @type {LH.Config.Plugin} */ module.exports = { diff --git a/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-simple/plugin-simple.js b/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-simple/plugin-simple.js index 29e2b65b3f26..96202c503243 100644 --- a/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-simple/plugin-simple.js +++ b/lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-simple/plugin-simple.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /** @type {LH.Config.Plugin} */ module.exports = { diff --git a/lighthouse-core/test/fixtures/config/config/config.js b/lighthouse-core/test/fixtures/config/config/config.js index 1235ba7514da..8605c7517efb 100644 --- a/lighthouse-core/test/fixtures/config/config/config.js +++ b/lighthouse-core/test/fixtures/config/config/config.js @@ -1,4 +1,4 @@ -'use strict'; + module.exports = { extends: 'lighthouse:default', diff --git a/lighthouse-core/test/fixtures/config/lighthouse-plugin-config-helper/plugin-config-helper.js b/lighthouse-core/test/fixtures/config/lighthouse-plugin-config-helper/plugin-config-helper.js index ef6e2535adc9..a58f50e492b3 100644 --- a/lighthouse-core/test/fixtures/config/lighthouse-plugin-config-helper/plugin-config-helper.js +++ b/lighthouse-core/test/fixtures/config/lighthouse-plugin-config-helper/plugin-config-helper.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /** @type {LH.Config.Plugin} */ module.exports = { diff --git a/lighthouse-core/test/fixtures/invalid-audits/missing-audit.js b/lighthouse-core/test/fixtures/invalid-audits/missing-audit.js index 810fe6447a87..594b1d1b10ae 100644 --- a/lighthouse-core/test/fixtures/invalid-audits/missing-audit.js +++ b/lighthouse-core/test/fixtures/invalid-audits/missing-audit.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; const LighthouseAudit = require('../../../audits/audit.js'); diff --git a/lighthouse-core/test/fixtures/invalid-audits/missing-description.js b/lighthouse-core/test/fixtures/invalid-audits/missing-description.js index 66d7d23bb642..87e8c5d2e3c4 100644 --- a/lighthouse-core/test/fixtures/invalid-audits/missing-description.js +++ b/lighthouse-core/test/fixtures/invalid-audits/missing-description.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; const LighthouseAudit = require('../../../audits/audit.js'); diff --git a/lighthouse-core/test/fixtures/invalid-audits/missing-generate-audit-result.js b/lighthouse-core/test/fixtures/invalid-audits/missing-generate-audit-result.js index 4cc80ea483dc..fba5f82ff8de 100644 --- a/lighthouse-core/test/fixtures/invalid-audits/missing-generate-audit-result.js +++ b/lighthouse-core/test/fixtures/invalid-audits/missing-generate-audit-result.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; class MissingGenerateAuditResult { static get meta() { diff --git a/lighthouse-core/test/fixtures/invalid-audits/missing-id.js b/lighthouse-core/test/fixtures/invalid-audits/missing-id.js index 8fd690b963fb..01e554f28690 100644 --- a/lighthouse-core/test/fixtures/invalid-audits/missing-id.js +++ b/lighthouse-core/test/fixtures/invalid-audits/missing-id.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; const LighthouseAudit = require('../../../audits/audit.js'); diff --git a/lighthouse-core/test/fixtures/invalid-audits/missing-meta.js b/lighthouse-core/test/fixtures/invalid-audits/missing-meta.js index 450a95e153b5..0f76a720f7fb 100644 --- a/lighthouse-core/test/fixtures/invalid-audits/missing-meta.js +++ b/lighthouse-core/test/fixtures/invalid-audits/missing-meta.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; const LighthouseAudit = require('../../../audits/audit.js'); diff --git a/lighthouse-core/test/fixtures/invalid-audits/missing-required-artifacts.js b/lighthouse-core/test/fixtures/invalid-audits/missing-required-artifacts.js index 21b832fa24fb..01206d2c8d3d 100644 --- a/lighthouse-core/test/fixtures/invalid-audits/missing-required-artifacts.js +++ b/lighthouse-core/test/fixtures/invalid-audits/missing-required-artifacts.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; const LighthouseAudit = require('../../../audits/audit.js'); diff --git a/lighthouse-core/test/fixtures/invalid-audits/missing-title.js b/lighthouse-core/test/fixtures/invalid-audits/missing-title.js index e1c5e15df117..0e27948cc263 100644 --- a/lighthouse-core/test/fixtures/invalid-audits/missing-title.js +++ b/lighthouse-core/test/fixtures/invalid-audits/missing-title.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; const LighthouseAudit = require('../../../audits/audit.js'); diff --git a/lighthouse-core/test/fixtures/invalid-audits/require-error.js b/lighthouse-core/test/fixtures/invalid-audits/require-error.js index d7e916a52cc9..7b256520f7db 100644 --- a/lighthouse-core/test/fixtures/invalid-audits/require-error.js +++ b/lighthouse-core/test/fixtures/invalid-audits/require-error.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + // NOTE: this require path does not resolve correctly. // eslint-disable-next-line local-rules/require-file-extension diff --git a/lighthouse-core/test/fixtures/invalid-gatherers/missing-after-pass.js b/lighthouse-core/test/fixtures/invalid-gatherers/missing-after-pass.js index 2381c4990d64..866b723e32c1 100644 --- a/lighthouse-core/test/fixtures/invalid-gatherers/missing-after-pass.js +++ b/lighthouse-core/test/fixtures/invalid-gatherers/missing-after-pass.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; class MissingAfterPass { beforePass() {} diff --git a/lighthouse-core/test/fixtures/invalid-gatherers/missing-before-pass.js b/lighthouse-core/test/fixtures/invalid-gatherers/missing-before-pass.js index c5e89344eba6..66319e205b3e 100644 --- a/lighthouse-core/test/fixtures/invalid-gatherers/missing-before-pass.js +++ b/lighthouse-core/test/fixtures/invalid-gatherers/missing-before-pass.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; class MissingBeforePass { pass() {} diff --git a/lighthouse-core/test/fixtures/invalid-gatherers/missing-pass.js b/lighthouse-core/test/fixtures/invalid-gatherers/missing-pass.js index 30bac9beb67b..57de2427ccaf 100644 --- a/lighthouse-core/test/fixtures/invalid-gatherers/missing-pass.js +++ b/lighthouse-core/test/fixtures/invalid-gatherers/missing-pass.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; class MissingPass { beforePass() {} diff --git a/lighthouse-core/test/fixtures/invalid-gatherers/require-error.js b/lighthouse-core/test/fixtures/invalid-gatherers/require-error.js index 664f7432b1f7..a5fd487f679e 100644 --- a/lighthouse-core/test/fixtures/invalid-gatherers/require-error.js +++ b/lighthouse-core/test/fixtures/invalid-gatherers/require-error.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + // NOTE: this require path does not resolve correctly. // eslint-disable-next-line local-rules/require-file-extension diff --git a/lighthouse-core/test/fixtures/valid-custom-audit.js b/lighthouse-core/test/fixtures/valid-custom-audit.js index fd6e7b83484e..2bcc3133af9a 100644 --- a/lighthouse-core/test/fixtures/valid-custom-audit.js +++ b/lighthouse-core/test/fixtures/valid-custom-audit.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; const LighthouseAudit = require('../../audits/audit.js'); diff --git a/lighthouse-core/test/fixtures/valid-custom-gatherer.js b/lighthouse-core/test/fixtures/valid-custom-gatherer.js index 527f1d1c2f98..4d43e67f2fea 100644 --- a/lighthouse-core/test/fixtures/valid-custom-gatherer.js +++ b/lighthouse-core/test/fixtures/valid-custom-gatherer.js @@ -4,7 +4,6 @@ * 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. */ -'use strict'; const LighthouseGatherer = require('../../gather/gatherers/gatherer.js'); diff --git a/lighthouse-core/test/fraggle-rock/config/config-test.js b/lighthouse-core/test/fraggle-rock/config/config-test.js index 7976f84eaf4f..bf214e384410 100644 --- a/lighthouse-core/test/fraggle-rock/config/config-test.js +++ b/lighthouse-core/test/fraggle-rock/config/config-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {jest} from '@jest/globals'; + import BaseAudit from '../../../audits/audit.js'; import constants from '../../../config/constants.js'; import BaseGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; diff --git a/lighthouse-core/test/fraggle-rock/config/filters-test.js b/lighthouse-core/test/fraggle-rock/config/filters-test.js index ee3c2b14026a..c59b7ac6062a 100644 --- a/lighthouse-core/test/fraggle-rock/config/filters-test.js +++ b/lighthouse-core/test/fraggle-rock/config/filters-test.js @@ -3,14 +3,15 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import log from 'lighthouse-logger'; import BaseAudit from '../../../audits/audit.js'; import BaseGatherer from '../../../fraggle-rock/gather/base-gatherer.js'; import {defaultSettings, defaultNavigationConfig} from '../../../config/constants.js'; import filters from '../../../fraggle-rock/config/filters.js'; import {initializeConfig} from '../../../fraggle-rock/config/config.js'; -import log from 'lighthouse-logger'; /* eslint-env jest */ diff --git a/lighthouse-core/test/fraggle-rock/config/validation-test.js b/lighthouse-core/test/fraggle-rock/config/validation-test.js index dc1edb72cbba..3627269f4624 100644 --- a/lighthouse-core/test/fraggle-rock/config/validation-test.js +++ b/lighthouse-core/test/fraggle-rock/config/validation-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {defaultSettings, defaultNavigationConfig} from '../../../config/constants.js'; import defaultConfig from '../../../fraggle-rock/config/default-config.js'; diff --git a/lighthouse-core/test/fraggle-rock/gather/base-artifacts-test.js b/lighthouse-core/test/fraggle-rock/gather/base-artifacts-test.js index 140cbb69b221..1553df19581b 100644 --- a/lighthouse-core/test/fraggle-rock/gather/base-artifacts-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/base-artifacts-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {getBaseArtifacts, finalizeArtifacts} from '../../../fraggle-rock/gather/base-artifacts.js'; - import {initializeConfig} from '../../../fraggle-rock/config/config.js'; import {createMockDriver} from './mock-driver.js'; import LighthouseError from '../../../lib/lh-error.js'; diff --git a/lighthouse-core/test/fraggle-rock/gather/base-gatherer-test.js b/lighthouse-core/test/fraggle-rock/gather/base-gatherer-test.js index 7d2411f4522f..c827e9c0af06 100644 --- a/lighthouse-core/test/fraggle-rock/gather/base-gatherer-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/base-gatherer-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import Gatherer from '../../../fraggle-rock/gather/base-gatherer.js'; import {fnAny} from '../../test-utils.js'; diff --git a/lighthouse-core/test/fraggle-rock/gather/driver-test.js b/lighthouse-core/test/fraggle-rock/gather/driver-test.js index 187a7b53cf0c..38e0e676c34f 100644 --- a/lighthouse-core/test/fraggle-rock/gather/driver-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/driver-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import Driver from '../../../fraggle-rock/gather/driver.js'; import {fnAny} from '../../test-utils.js'; diff --git a/lighthouse-core/test/fraggle-rock/gather/mock-driver.js b/lighthouse-core/test/fraggle-rock/gather/mock-driver.js index acc2cb229148..aca4cdb752b3 100644 --- a/lighthouse-core/test/fraggle-rock/gather/mock-driver.js +++ b/lighthouse-core/test/fraggle-rock/gather/mock-driver.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /** * @fileoverview Mock fraggle rock driver for testing. @@ -12,6 +12,7 @@ /* eslint-env jest */ import {jest} from '@jest/globals'; + import { createMockOnFn, createMockOnceFn, diff --git a/lighthouse-core/test/fraggle-rock/gather/navigation-runner-test.js b/lighthouse-core/test/fraggle-rock/gather/navigation-runner-test.js index f928768cf674..802b524682a9 100644 --- a/lighthouse-core/test/fraggle-rock/gather/navigation-runner-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/navigation-runner-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + import { createMockDriver, createMockBaseArtifacts, diff --git a/lighthouse-core/test/fraggle-rock/gather/runner-helpers-test.js b/lighthouse-core/test/fraggle-rock/gather/runner-helpers-test.js index 5cc830eeba6c..83b0a707ad35 100644 --- a/lighthouse-core/test/fraggle-rock/gather/runner-helpers-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/runner-helpers-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import helpers from '../../../fraggle-rock/gather/runner-helpers.js'; import Gatherer from '../../../fraggle-rock/gather/base-gatherer.js'; diff --git a/lighthouse-core/test/fraggle-rock/gather/session-test.js b/lighthouse-core/test/fraggle-rock/gather/session-test.js index ce090416d626..bf3818d6b7d0 100644 --- a/lighthouse-core/test/fraggle-rock/gather/session-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/session-test.js @@ -3,12 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import {jest} from '@jest/globals'; import {EventEmitter} from 'events'; + +import {jest} from '@jest/globals'; + import ProtocolSession from '../../../fraggle-rock/gather/session.js'; import { flushAllTimersAndMicrotasks, diff --git a/lighthouse-core/test/fraggle-rock/gather/snapshot-runner-test.js b/lighthouse-core/test/fraggle-rock/gather/snapshot-runner-test.js index e24cf8a704f9..8de48e403829 100644 --- a/lighthouse-core/test/fraggle-rock/gather/snapshot-runner-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/snapshot-runner-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + // import {snapshotGather} from '../../../fraggle-rock/gather/snapshot-runner.js'; import { createMockDriver, diff --git a/lighthouse-core/test/fraggle-rock/gather/timespan-runner-test.js b/lighthouse-core/test/fraggle-rock/gather/timespan-runner-test.js index 4837fba3e8be..588bd78a5192 100644 --- a/lighthouse-core/test/fraggle-rock/gather/timespan-runner-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/timespan-runner-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + // import {startTimespanGather} from '../../../fraggle-rock/gather/timespan-runner.js'; import { createMockDriver, diff --git a/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js b/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js index e7a38441bde8..b61085170d37 100644 --- a/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js +++ b/lighthouse-core/test/fraggle-rock/scenarios/api-test-pptr.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {jest} from '@jest/globals'; diff --git a/lighthouse-core/test/fraggle-rock/scenarios/disconnect-test-pptr.js b/lighthouse-core/test/fraggle-rock/scenarios/disconnect-test-pptr.js index 23722ae61603..8e7c86437996 100644 --- a/lighthouse-core/test/fraggle-rock/scenarios/disconnect-test-pptr.js +++ b/lighthouse-core/test/fraggle-rock/scenarios/disconnect-test-pptr.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {jest} from '@jest/globals'; diff --git a/lighthouse-core/test/fraggle-rock/scenarios/pptr-test-utils.js b/lighthouse-core/test/fraggle-rock/scenarios/pptr-test-utils.js index af68b10ca8aa..e93543cb63e9 100644 --- a/lighthouse-core/test/fraggle-rock/scenarios/pptr-test-utils.js +++ b/lighthouse-core/test/fraggle-rock/scenarios/pptr-test-utils.js @@ -3,11 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; import {beforeAll, beforeEach, afterAll, afterEach} from '@jest/globals'; import puppeteer from 'puppeteer-core'; import {getChromePath} from 'chrome-launcher'; + import {Server} from '../../../../lighthouse-cli/test/fixtures/static-server.js'; /** @typedef {InstanceType} StaticServer */ @@ -22,7 +22,7 @@ const FLAKY_AUDIT_IDS_APPLICABILITY = new Set([ 'layout-shift-elements', // Depends on if the JS takes too long after input to be ignored for layout shift. ]); -export function createTestState() { +function createTestState() { /** @param {string} name @return {any} */ const any = name => new Proxy({}, {get: () => { throw new Error(`${name} used without invoking \`state.beforeAll\``); @@ -64,7 +64,7 @@ export function createTestState() { /** * @param {LH.Result} lhr */ -export function getAuditsBreakdown(lhr) { +function getAuditsBreakdown(lhr) { const auditResults = Object.values(lhr.audits); const irrelevantDisplayModes = new Set(['notApplicable', 'manual']); const applicableAudits = auditResults.filter( @@ -90,3 +90,8 @@ export function getAuditsBreakdown(lhr) { return {auditResults, erroredAudits, failedAudits, notApplicableAudits}; } + +export { + createTestState, + getAuditsBreakdown, +}; diff --git a/lighthouse-core/test/fraggle-rock/user-flow-test.js b/lighthouse-core/test/fraggle-rock/user-flow-test.js index 451fa2b3f288..8bb53feb2f33 100644 --- a/lighthouse-core/test/fraggle-rock/user-flow-test.js +++ b/lighthouse-core/test/fraggle-rock/user-flow-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + import {createMockPage, mockRunnerModule} from './gather/mock-driver.js'; // import UserFlow from '../../fraggle-rock/user-flow.js'; diff --git a/lighthouse-core/test/gather/devtools-log-test.js b/lighthouse-core/test/gather/devtools-log-test.js index d8ce65461aea..387b3b9b139b 100644 --- a/lighthouse-core/test/gather/devtools-log-test.js +++ b/lighthouse-core/test/gather/devtools-log-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/driver-test.js b/lighthouse-core/test/gather/driver-test.js index 6031173ca068..fe3e3023643c 100644 --- a/lighthouse-core/test/gather/driver-test.js +++ b/lighthouse-core/test/gather/driver-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + import Driver from '../../gather/driver.js'; import Connection from '../../gather/connections/connection.js'; import FakeDriver from './fake-driver.js'; diff --git a/lighthouse-core/test/gather/driver/dom-test.js b/lighthouse-core/test/gather/driver/dom-test.js index 9b496391e710..60c9448e8049 100644 --- a/lighthouse-core/test/gather/driver/dom-test.js +++ b/lighthouse-core/test/gather/driver/dom-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/driver/environment-test.js b/lighthouse-core/test/gather/driver/environment-test.js index 8435d9993d2b..0d93bc61a3bf 100644 --- a/lighthouse-core/test/gather/driver/environment-test.js +++ b/lighthouse-core/test/gather/driver/environment-test.js @@ -3,14 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {defaultSettings} from '../../../config/constants.js'; - import environment from '../../../gather/driver/environment.js'; - import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; describe('.getBrowserVersion', () => { diff --git a/lighthouse-core/test/gather/driver/execution-context-test.js b/lighthouse-core/test/gather/driver/execution-context-test.js index 9078ce44e0f1..2181725ca0f0 100644 --- a/lighthouse-core/test/gather/driver/execution-context-test.js +++ b/lighthouse-core/test/gather/driver/execution-context-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + import ExecutionContext from '../../../gather/driver/execution-context.js'; import { mockCommands, diff --git a/lighthouse-core/test/gather/driver/navigation-test.js b/lighthouse-core/test/gather/driver/navigation-test.js index d9722be03eab..5f27331f94bd 100644 --- a/lighthouse-core/test/gather/driver/navigation-test.js +++ b/lighthouse-core/test/gather/driver/navigation-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import 'lighthouse-logger'; // Needed otherwise `log.timeEnd` errors in navigation.js inexplicably. import {jest} from '@jest/globals'; + import {createMockDriver, mockTargetManagerModule} from '../../fraggle-rock/gather/mock-driver.js'; import { mockCommands, diff --git a/lighthouse-core/test/gather/driver/network-monitor-test.js b/lighthouse-core/test/gather/driver/network-monitor-test.js index 4c3862bd54d5..284bbc35b005 100644 --- a/lighthouse-core/test/gather/driver/network-monitor-test.js +++ b/lighthouse-core/test/gather/driver/network-monitor-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + import {mockDriverSubmodules} from '../../fraggle-rock/gather/mock-driver.js'; // import NetworkMonitor from '../../../gather/driver/network-monitor.js'; import NetworkRequest from '../../../lib/network-request.js'; diff --git a/lighthouse-core/test/gather/driver/prepare-test.js b/lighthouse-core/test/gather/driver/prepare-test.js index d781ccda9518..b0ed01b35b83 100644 --- a/lighthouse-core/test/gather/driver/prepare-test.js +++ b/lighthouse-core/test/gather/driver/prepare-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + import {createMockSession, createMockDriver} from '../../fraggle-rock/gather/mock-driver.js'; import {flushAllTimersAndMicrotasks, fnAny} from '../../test-utils.js'; // import prepare from '../../../gather/driver/prepare.js'; diff --git a/lighthouse-core/test/gather/driver/service-workers-test.js b/lighthouse-core/test/gather/driver/service-workers-test.js index 70c52883eb22..1d236201fbd3 100644 --- a/lighthouse-core/test/gather/driver/service-workers-test.js +++ b/lighthouse-core/test/gather/driver/service-workers-test.js @@ -3,13 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; -import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; +import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; import {makePromiseInspectable, flushAllTimersAndMicrotasks} from '../../test-utils.js'; import serviceWorkers from '../../../gather/driver/service-workers.js'; diff --git a/lighthouse-core/test/gather/driver/storage-test.js b/lighthouse-core/test/gather/driver/storage-test.js index d7be25d2c7a7..40e2cb965ece 100644 --- a/lighthouse-core/test/gather/driver/storage-test.js +++ b/lighthouse-core/test/gather/driver/storage-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; - import storage from '../../../gather/driver/storage.js'; let sessionMock = createMockSession(); diff --git a/lighthouse-core/test/gather/driver/target-manager-test.js b/lighthouse-core/test/gather/driver/target-manager-test.js index bf26d7523bdb..a7aeb0b2589a 100644 --- a/lighthouse-core/test/gather/driver/target-manager-test.js +++ b/lighthouse-core/test/gather/driver/target-manager-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {jest} from '@jest/globals'; + import TargetManager from '../../../gather/driver/target-manager.js'; import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; import {fnAny} from '../../test-utils.js'; diff --git a/lighthouse-core/test/gather/driver/wait-for-condition-test.js b/lighthouse-core/test/gather/driver/wait-for-condition-test.js index 8f855a2143be..38780e3aaed2 100644 --- a/lighthouse-core/test/gather/driver/wait-for-condition-test.js +++ b/lighthouse-core/test/gather/driver/wait-for-condition-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + import wait from '../../../gather/driver/wait-for-condition.js'; import { mockCommands, diff --git a/lighthouse-core/test/gather/fake-driver.js b/lighthouse-core/test/gather/fake-driver.js index d270e213bd8a..0ed8362f0be3 100644 --- a/lighthouse-core/test/gather/fake-driver.js +++ b/lighthouse-core/test/gather/fake-driver.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/fetcher-test.js b/lighthouse-core/test/gather/fetcher-test.js index a40e0a750287..3ab88de22b33 100644 --- a/lighthouse-core/test/gather/fetcher-test.js +++ b/lighthouse-core/test/gather/fetcher-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + import Connection from '../../gather/connections/connection.js'; import {fnAny, mockCommands} from '../test-utils.js'; diff --git a/lighthouse-core/test/gather/gather-runner-test.js b/lighthouse-core/test/gather/gather-runner-test.js index 157ce5e193e5..6c0c468abd6c 100644 --- a/lighthouse-core/test/gather/gather-runner-test.js +++ b/lighthouse-core/test/gather/gather-runner-test.js @@ -3,14 +3,16 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import {strict as assert} from 'assert'; + import {jest} from '@jest/globals'; + import Gatherer from '../../gather/gatherers/gatherer.js'; // import GathererRunner_ from '../../gather/gather-runner.js'; -import {strict as assert} from 'assert'; // import Config from '../../config/config.js'; import unresolvedPerfLog from './../fixtures/unresolved-perflog.json'; import LHError from '../../lib/lh-error.js'; diff --git a/lighthouse-core/test/gather/gatherers/accessibility-test.js b/lighthouse-core/test/gather/gatherers/accessibility-test.js index d9e299b03962..33d7f1ef8057 100644 --- a/lighthouse-core/test/gather/gatherers/accessibility-test.js +++ b/lighthouse-core/test/gather/gatherers/accessibility-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import fs from 'fs'; import {strict as assert} from 'assert'; + import puppeteer from 'puppeteer'; import AccessibilityGather from '../../../gather/gatherers/accessibility.js'; diff --git a/lighthouse-core/test/gather/gatherers/cache-contents-test.js b/lighthouse-core/test/gather/gatherers/cache-contents-test.js index c78dc37bfe0a..b99d44c43254 100644 --- a/lighthouse-core/test/gather/gatherers/cache-contents-test.js +++ b/lighthouse-core/test/gather/gatherers/cache-contents-test.js @@ -3,13 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import {strict as assert} from 'assert'; + import CacheContentGather from '../../../gather/gatherers/cache-contents.js'; -import {strict as assert} from 'assert'; let cacheContentGather; describe('Cache Contents gatherer', () => { diff --git a/lighthouse-core/test/gather/gatherers/console-messages-test.js b/lighthouse-core/test/gather/gatherers/console-messages-test.js index 8f870f395485..d945b6e540c5 100644 --- a/lighthouse-core/test/gather/gatherers/console-messages-test.js +++ b/lighthouse-core/test/gather/gatherers/console-messages-test.js @@ -3,13 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import {strict as assert} from 'assert'; + import ConsoleMessagesGatherer from '../../../gather/gatherers/console-messages.js'; -import {strict as assert} from 'assert'; class MockSession { constructor() { diff --git a/lighthouse-core/test/gather/gatherers/css-usage-test.js b/lighthouse-core/test/gather/gatherers/css-usage-test.js index e8e4572d2fa2..546fb9800576 100644 --- a/lighthouse-core/test/gather/gatherers/css-usage-test.js +++ b/lighthouse-core/test/gather/gatherers/css-usage-test.js @@ -3,14 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; 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 {flushAllTimersAndMicrotasks} from '../../test-utils.js'; diff --git a/lighthouse-core/test/gather/gatherers/dobetterweb/optimized-images-test.js b/lighthouse-core/test/gather/gatherers/dobetterweb/optimized-images-test.js index 96004d23ab26..862eeb028209 100644 --- a/lighthouse-core/test/gather/gatherers/dobetterweb/optimized-images-test.js +++ b/lighthouse-core/test/gather/gatherers/dobetterweb/optimized-images-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import OptimizedImages from '../../../../gather/gatherers/dobetterweb/optimized-images.js'; - import {createMockContext} from '../../../fraggle-rock/gather/mock-driver.js'; let context = createMockContext(); diff --git a/lighthouse-core/test/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste-test.js b/lighthouse-core/test/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste-test.js index de84ca38eb01..e43fe4e963d9 100644 --- a/lighthouse-core/test/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste-test.js +++ b/lighthouse-core/test/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste-test.js @@ -3,14 +3,15 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import {strict as assert} from 'assert'; + import PasswordInputsWithPreventedPasteGatherer from '../../../../gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js'; -import {strict as assert} from 'assert'; let gatherer; describe('PasswordInputsWithPreventedPaste gatherer', () => { diff --git a/lighthouse-core/test/gather/gatherers/dobetterweb/response-compression-test.js b/lighthouse-core/test/gather/gatherers/dobetterweb/response-compression-test.js index 2640b5ec6299..74aad2d6f67b 100644 --- a/lighthouse-core/test/gather/gatherers/dobetterweb/response-compression-test.js +++ b/lighthouse-core/test/gather/gatherers/dobetterweb/response-compression-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/gatherers/dobetterweb/tags-blocking-first-paint-test.js b/lighthouse-core/test/gather/gatherers/dobetterweb/tags-blocking-first-paint-test.js index fc23fc7cccfb..b01b20b1734a 100644 --- a/lighthouse-core/test/gather/gatherers/dobetterweb/tags-blocking-first-paint-test.js +++ b/lighthouse-core/test/gather/gatherers/dobetterweb/tags-blocking-first-paint-test.js @@ -3,13 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import TagsBlockingFirstPaint from '../../../../gather/gatherers/dobetterweb/tags-blocking-first-paint.js'; - import {createMockContext} from '../../../fraggle-rock/gather/mock-driver.js'; let tagsBlockingFirstPaint; diff --git a/lighthouse-core/test/gather/gatherers/full-page-screenshot-test.js b/lighthouse-core/test/gather/gatherers/full-page-screenshot-test.js index e2c409cb4e2f..c6693b01f915 100644 --- a/lighthouse-core/test/gather/gatherers/full-page-screenshot-test.js +++ b/lighthouse-core/test/gather/gatherers/full-page-screenshot-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + import {createMockContext, mockDriverSubmodules} from '../../fraggle-rock/gather/mock-driver.js'; // import FullPageScreenshotGatherer from '../../../gather/gatherers/full-page-screenshot.js'; diff --git a/lighthouse-core/test/gather/gatherers/gatherer-test.js b/lighthouse-core/test/gather/gatherers/gatherer-test.js index 7afd806b24bb..8edbb5d18b29 100644 --- a/lighthouse-core/test/gather/gatherers/gatherer-test.js +++ b/lighthouse-core/test/gather/gatherers/gatherer-test.js @@ -3,13 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import {strict as assert} from 'assert'; + import Gatherer from '../../../gather/gatherers/gatherer.js'; -import {strict as assert} from 'assert'; describe('Gatherer', () => { it('returns its name', () => { diff --git a/lighthouse-core/test/gather/gatherers/global-listeners-test.js b/lighthouse-core/test/gather/gatherers/global-listeners-test.js index 6b905a2a4e67..f6f6107aa403 100644 --- a/lighthouse-core/test/gather/gatherers/global-listeners-test.js +++ b/lighthouse-core/test/gather/gatherers/global-listeners-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import GlobalListenerGatherer from '../../../gather/gatherers/global-listeners.js'; - import {createMockSendCommandFn} from '../mock-commands.js'; import Connection from '../../../gather/connections/connection.js'; import Driver from '../../../gather/driver.js'; diff --git a/lighthouse-core/test/gather/gatherers/image-elements-test.js b/lighthouse-core/test/gather/gatherers/image-elements-test.js index b6f9184e2637..033cd5ecc2fb 100644 --- a/lighthouse-core/test/gather/gatherers/image-elements-test.js +++ b/lighthouse-core/test/gather/gatherers/image-elements-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/gatherers/inspector-issues-test.js b/lighthouse-core/test/gather/gatherers/inspector-issues-test.js index 420fa86472ce..44339a0efa08 100644 --- a/lighthouse-core/test/gather/gatherers/inspector-issues-test.js +++ b/lighthouse-core/test/gather/gatherers/inspector-issues-test.js @@ -3,14 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; 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 {flushAllTimersAndMicrotasks} from '../../test-utils.js'; diff --git a/lighthouse-core/test/gather/gatherers/installability-errors-test.js b/lighthouse-core/test/gather/gatherers/installability-errors-test.js index 22f2aaf8d6a8..1e6ae49d9005 100644 --- a/lighthouse-core/test/gather/gatherers/installability-errors-test.js +++ b/lighthouse-core/test/gather/gatherers/installability-errors-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import InstallabilityErrors from '../../../gather/gatherers/installability-errors.js'; - import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; diff --git a/lighthouse-core/test/gather/gatherers/js-usage-test.js b/lighthouse-core/test/gather/gatherers/js-usage-test.js index e0f2c17bab17..517af1dd9d28 100644 --- a/lighthouse-core/test/gather/gatherers/js-usage-test.js +++ b/lighthouse-core/test/gather/gatherers/js-usage-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/gatherers/link-elements-test.js b/lighthouse-core/test/gather/gatherers/link-elements-test.js index 4e177d464cb9..1db7f1cd4d07 100644 --- a/lighthouse-core/test/gather/gatherers/link-elements-test.js +++ b/lighthouse-core/test/gather/gatherers/link-elements-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/gatherers/main-document-content-test.js b/lighthouse-core/test/gather/gatherers/main-document-content-test.js index a79a2c0ae52a..1ad2232ae2df 100644 --- a/lighthouse-core/test/gather/gatherers/main-document-content-test.js +++ b/lighthouse-core/test/gather/gatherers/main-document-content-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ 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 {getURLArtifactFromDevtoolsLog} from '../../test-utils.js'; diff --git a/lighthouse-core/test/gather/gatherers/network-user-agent-test.js b/lighthouse-core/test/gather/gatherers/network-user-agent-test.js index 340da8ecabf6..e07a3e141610 100644 --- a/lighthouse-core/test/gather/gatherers/network-user-agent-test.js +++ b/lighthouse-core/test/gather/gatherers/network-user-agent-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/gatherers/script-elements-test.js b/lighthouse-core/test/gather/gatherers/script-elements-test.js index 296387cb6f71..53f77ffef963 100644 --- a/lighthouse-core/test/gather/gatherers/script-elements-test.js +++ b/lighthouse-core/test/gather/gatherers/script-elements-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/gatherers/seo/font-size-test.js b/lighthouse-core/test/gather/gatherers/seo/font-size-test.js index eae471fccb3b..8f7c48ae2629 100644 --- a/lighthouse-core/test/gather/gatherers/seo/font-size-test.js +++ b/lighthouse-core/test/gather/gatherers/seo/font-size-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/gatherers/service-worker-test.js b/lighthouse-core/test/gather/gatherers/service-worker-test.js index d15c57d3f310..ccc15415d2f4 100644 --- a/lighthouse-core/test/gather/gatherers/service-worker-test.js +++ b/lighthouse-core/test/gather/gatherers/service-worker-test.js @@ -3,12 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import {jest} from '@jest/globals'; import {strict as assert} from 'assert'; + +import {jest} from '@jest/globals'; + import {fnAny} from '../../test-utils.js'; // import ServiceWorkerGather from '../../../gather/gatherers/service-worker.js'; diff --git a/lighthouse-core/test/gather/gatherers/source-maps-test.js b/lighthouse-core/test/gather/gatherers/source-maps-test.js index b16ad220789c..f5202f5b7f27 100644 --- a/lighthouse-core/test/gather/gatherers/source-maps-test.js +++ b/lighthouse-core/test/gather/gatherers/source-maps-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/gatherers/stacks-test.js b/lighthouse-core/test/gather/gatherers/stacks-test.js index a9ef69da60a1..c2f1c2028306 100644 --- a/lighthouse-core/test/gather/gatherers/stacks-test.js +++ b/lighthouse-core/test/gather/gatherers/stacks-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/gather/gatherers/trace-elements-test.js b/lighthouse-core/test/gather/gatherers/trace-elements-test.js index 914a022bb58b..3c99e1069351 100644 --- a/lighthouse-core/test/gather/gatherers/trace-elements-test.js +++ b/lighthouse-core/test/gather/gatherers/trace-elements-test.js @@ -3,14 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; import TraceElementsGatherer from '../../../gather/gatherers/trace-elements.js'; - import Driver from '../../../gather/driver.js'; import Connection from '../../../gather/connections/connection.js'; import createTestTrace from '../../create-test-trace.js'; diff --git a/lighthouse-core/test/gather/gatherers/trace-test.js b/lighthouse-core/test/gather/gatherers/trace-test.js index 560652e0a2f4..c1a7be6cdfd7 100644 --- a/lighthouse-core/test/gather/gatherers/trace-test.js +++ b/lighthouse-core/test/gather/gatherers/trace-test.js @@ -3,14 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; import {makePromiseInspectable, flushAllTimersAndMicrotasks} from '../../test-utils.js'; - import {createMockContext} from '../../fraggle-rock/gather/mock-driver.js'; import TraceGatherer from '../../../gather/gatherers/trace.js'; diff --git a/lighthouse-core/test/gather/gatherers/viewport-dimensions-test.js b/lighthouse-core/test/gather/gatherers/viewport-dimensions-test.js index 2713801ab0ac..dee13b36b125 100644 --- a/lighthouse-core/test/gather/gatherers/viewport-dimensions-test.js +++ b/lighthouse-core/test/gather/gatherers/viewport-dimensions-test.js @@ -3,13 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import {strict as assert} from 'assert'; + import ViewportDimensionsGatherer from '../../../gather/gatherers/viewport-dimensions.js'; -import {strict as assert} from 'assert'; let gatherer; describe('ViewportDimensions gatherer', () => { diff --git a/lighthouse-core/test/gather/gatherers/web-app-manifest-test.js b/lighthouse-core/test/gather/gatherers/web-app-manifest-test.js index 590dac46c4ae..8a2745d85b9f 100644 --- a/lighthouse-core/test/gather/gatherers/web-app-manifest-test.js +++ b/lighthouse-core/test/gather/gatherers/web-app-manifest-test.js @@ -3,15 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import fs from 'fs'; -import {LH_ROOT} from '../../../../root.js'; +import {LH_ROOT} from '../../../../root.js'; import WebAppManifest from '../../../gather/gatherers/web-app-manifest.js'; - import {createMockSession} from '../../fraggle-rock/gather/mock-driver.js'; describe('WebAppManifest Gatherer', () => { diff --git a/lighthouse-core/test/gather/mock-commands.js b/lighthouse-core/test/gather/mock-commands.js index 64b3d1b4f546..a75089907f6e 100644 --- a/lighthouse-core/test/gather/mock-commands.js +++ b/lighthouse-core/test/gather/mock-commands.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /** * @fileoverview Refer to driver-test.js and source-maps-test.js for intended usage. diff --git a/lighthouse-core/test/index-test.js b/lighthouse-core/test/index-test.js index a5070ce385c7..025c35fa07aa 100644 --- a/lighthouse-core/test/index-test.js +++ b/lighthouse-core/test/index-test.js @@ -3,13 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -/* eslint-env jest */ -import pkg from '../../package.json'; +/* eslint-env jest */ import {strict as assert} from 'assert'; + +import pkg from '../../package.json'; import lighthouse from '../index.js'; import {LH_ROOT} from '../../root.js'; diff --git a/lighthouse-core/test/jest-setup/setup.js b/lighthouse-core/test/jest-setup/setup.js index 6ceb1e879990..b72678181bcc 100644 --- a/lighthouse-core/test/jest-setup/setup.js +++ b/lighthouse-core/test/jest-setup/setup.js @@ -3,13 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -const format = require('../../../shared/localization/format.js'); const {default: {toBeCloseTo}} = require('expect/build/matchers.js'); +const format = require('../../../shared/localization/format.js'); + expect.extend({ toBeDisplayString(received, expected) { if (!format.isIcuMessage(received)) { diff --git a/lighthouse-core/test/lib/arbitrary-equality-map-test.js b/lighthouse-core/test/lib/arbitrary-equality-map-test.js index 3f2efc1dbdd7..36315989ad72 100644 --- a/lighthouse-core/test/lib/arbitrary-equality-map-test.js +++ b/lighthouse-core/test/lib/arbitrary-equality-map-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/lib/asset-saver-test.js b/lighthouse-core/test/lib/asset-saver-test.js index 7c3073d66e4c..cae1c64cba75 100644 --- a/lighthouse-core/test/lib/asset-saver-test.js +++ b/lighthouse-core/test/lib/asset-saver-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import assetSaver from '../../lib/asset-saver.js'; -import Metrics from '../../lib/traces/pwmetrics-events.js'; + import {strict as assert} from 'assert'; import fs from 'fs'; + +import assetSaver from '../../lib/asset-saver.js'; +import Metrics from '../../lib/traces/pwmetrics-events.js'; import LHError from '../../lib/lh-error.js'; import traceEvents from '../fixtures/traces/progressive-app.json'; import dbwTrace from '../results/artifacts/defaultPass.trace.json'; diff --git a/lighthouse-core/test/lib/csp-evaluator-test.js b/lighthouse-core/test/lib/csp-evaluator-test.js index ff40d825e374..67a05e43e518 100644 --- a/lighthouse-core/test/lib/csp-evaluator-test.js +++ b/lighthouse-core/test/lib/csp-evaluator-test.js @@ -3,16 +3,17 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import {isIcuMessage} from '../../../shared/localization/format.js'; -import {getTranslatedDescription, parseCsp} from '../../lib/csp-evaluator.js'; + import { evaluateForFailure, evaluateForWarnings, evaluateForSyntaxErrors, } from 'csp_evaluator/dist/lighthouse/lighthouse_checks.js'; +import {isIcuMessage} from '../../../shared/localization/format.js'; +import {getTranslatedDescription, parseCsp} from '../../lib/csp-evaluator.js'; + /** * @param {string[]} rawCsps */ diff --git a/lighthouse-core/test/lib/dependency-graph/base-node-test.js b/lighthouse-core/test/lib/dependency-graph/base-node-test.js index 68c79192491d..f01fb4d4baf7 100644 --- a/lighthouse-core/test/lib/dependency-graph/base-node-test.js +++ b/lighthouse-core/test/lib/dependency-graph/base-node-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import BaseNode from '../../../lib/dependency-graph/base-node.js'; import NetworkNode from '../../../lib/dependency-graph/network-node.js'; -import {strict as assert} from 'assert'; function sortedById(nodeArray) { return nodeArray.sort((node1, node2) => node1.id.localeCompare(node2.id)); diff --git a/lighthouse-core/test/lib/dependency-graph/simulator/connection-pool-test.js b/lighthouse-core/test/lib/dependency-graph/simulator/connection-pool-test.js index 9e48dff0052e..c243e75e11cc 100644 --- a/lighthouse-core/test/lib/dependency-graph/simulator/connection-pool-test.js +++ b/lighthouse-core/test/lib/dependency-graph/simulator/connection-pool-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import ConnectionPool from '../../../../lib/dependency-graph/simulator/connection-pool.js'; + import {strict as assert} from 'assert'; import {URL} from 'url'; +import ConnectionPool from '../../../../lib/dependency-graph/simulator/connection-pool.js'; + /* eslint-env jest */ describe('DependencyGraph/Simulator/ConnectionPool', () => { const rtt = 100; diff --git a/lighthouse-core/test/lib/dependency-graph/simulator/dns-cache-test.js b/lighthouse-core/test/lib/dependency-graph/simulator/dns-cache-test.js index 4ef312e1f2e4..c4f2982fc060 100644 --- a/lighthouse-core/test/lib/dependency-graph/simulator/dns-cache-test.js +++ b/lighthouse-core/test/lib/dependency-graph/simulator/dns-cache-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import DNSCache from '../../../../lib/dependency-graph/simulator/dns-cache.js'; const MULTIPLIER = DNSCache.RTT_MULTIPLIER; diff --git a/lighthouse-core/test/lib/dependency-graph/simulator/network-analyzer-test.js b/lighthouse-core/test/lib/dependency-graph/simulator/network-analyzer-test.js index 887e3c41b4b5..9dbcf4a941e0 100644 --- a/lighthouse-core/test/lib/dependency-graph/simulator/network-analyzer-test.js +++ b/lighthouse-core/test/lib/dependency-graph/simulator/network-analyzer-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import NetworkAnalyzer from '../../../../lib/dependency-graph/simulator/network-analyzer.js'; import NetworkRecords from '../../../../computed/network-records.js'; import devtoolsLog from '../../../fixtures/traces/progressive-app-m60.devtools.log.json'; diff --git a/lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js b/lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js index 502e48761b8e..07cd32ba17ba 100644 --- a/lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js +++ b/lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js @@ -3,14 +3,15 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import NetworkNode from '../../../../lib/dependency-graph/network-node.js'; import CpuNode from '../../../../lib/dependency-graph/cpu-node.js'; import Simulator from '../../../../lib/dependency-graph/simulator/simulator.js'; import DNSCache from '../../../../lib/dependency-graph/simulator/dns-cache.js'; import PageDependencyGraph from '../../../../computed/page-dependency-graph.js'; -import {strict as assert} from 'assert'; import {getURLArtifactFromDevtoolsLog} from '../../../test-utils.js'; import pwaTrace from '../../../fixtures/traces/progressive-app-m60.json'; import pwaDevtoolsLog from '../../../fixtures/traces/progressive-app-m60.devtools.log.json'; diff --git a/lighthouse-core/test/lib/dependency-graph/simulator/tcp-connection-test.js b/lighthouse-core/test/lib/dependency-graph/simulator/tcp-connection-test.js index 992b9ba483d5..3a1c5dbd545e 100644 --- a/lighthouse-core/test/lib/dependency-graph/simulator/tcp-connection-test.js +++ b/lighthouse-core/test/lib/dependency-graph/simulator/tcp-connection-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import TcpConnection from '../../../../lib/dependency-graph/simulator/tcp-connection.js'; + import {strict as assert} from 'assert'; +import TcpConnection from '../../../../lib/dependency-graph/simulator/tcp-connection.js'; + /* eslint-env jest */ describe('DependencyGraph/Simulator/TcpConnection', () => { describe('#constructor', () => { diff --git a/lighthouse-core/test/lib/emulation-test.js b/lighthouse-core/test/lib/emulation-test.js index 19c73bb513e7..d379e4af396d 100644 --- a/lighthouse-core/test/lib/emulation-test.js +++ b/lighthouse-core/test/lib/emulation-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import emulation from '../../lib/emulation.js'; import Driver from '../../gather/driver.js'; diff --git a/lighthouse-core/test/lib/i18n/i18n-test.js b/lighthouse-core/test/lib/i18n/i18n-test.js index ed93129f0228..b6c985d09505 100644 --- a/lighthouse-core/test/lib/i18n/i18n-test.js +++ b/lighthouse-core/test/lib/i18n/i18n-test.js @@ -3,12 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import {jest} from '@jest/globals'; + import path from 'path'; -import i18n from '../../../lib/i18n/i18n.js'; + +import {jest} from '@jest/globals'; import log from 'lighthouse-logger'; + +import i18n from '../../../lib/i18n/i18n.js'; import {createCommonjsRefs} from '../../../scripts/esm-utils.js'; const {__dirname} = createCommonjsRefs(import.meta); diff --git a/lighthouse-core/test/lib/icons-test.js b/lighthouse-core/test/lib/icons-test.js index 9a9857cb401e..fd241d0e6604 100644 --- a/lighthouse-core/test/lib/icons-test.js +++ b/lighthouse-core/test/lib/icons-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import icons from '../../lib/icons.js'; + import {strict as assert} from 'assert'; + +import icons from '../../lib/icons.js'; import manifestParser from '../../lib/manifest-parser.js'; const EXAMPLE_MANIFEST_URL = 'https://example.com/manifest.json'; diff --git a/lighthouse-core/test/lib/line-number-from-jsonld-path-test.js b/lighthouse-core/test/lib/line-number-from-jsonld-path-test.js index f4039b0362a5..dc1ab4eefaa2 100644 --- a/lighthouse-core/test/lib/line-number-from-jsonld-path-test.js +++ b/lighthouse-core/test/lib/line-number-from-jsonld-path-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import getLineNumberFromJsonLDPath from '../../lib/sd-validation/line-number-from-jsonld-path.js'; // eslint-disable-line max-len /* global describe, it */ diff --git a/lighthouse-core/test/lib/manifest-parser-test.js b/lighthouse-core/test/lib/manifest-parser-test.js index 1a85498481af..7adf5baffa26 100644 --- a/lighthouse-core/test/lib/manifest-parser-test.js +++ b/lighthouse-core/test/lib/manifest-parser-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import manifestParser from '../../lib/manifest-parser.js'; + import {strict as assert} from 'assert'; + +import manifestParser from '../../lib/manifest-parser.js'; import manifestStub from '../fixtures/manifest.json'; const EXAMPLE_MANIFEST_URL = 'https://example.com/manifest.json'; diff --git a/lighthouse-core/test/lib/median-run-test.js b/lighthouse-core/test/lib/median-run-test.js index 4b048ff0b504..154d7410862c 100644 --- a/lighthouse-core/test/lib/median-run-test.js +++ b/lighthouse-core/test/lib/median-run-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/lib/minification-estimator-test.js b/lighthouse-core/test/lib/minification-estimator-test.js index b81503ad0fee..746ab009ea79 100644 --- a/lighthouse-core/test/lib/minification-estimator-test.js +++ b/lighthouse-core/test/lib/minification-estimator-test.js @@ -3,12 +3,13 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import fs from 'fs'; import {strict as assert} from 'assert'; + import {computeCSSTokenLength, computeJSTokenLength} from '../../lib/minification-estimator.js'; // eslint-disable-line max-len import {LH_ROOT} from '../../../root.js'; import {createCommonjsRefs} from '../../scripts/esm-utils.js'; diff --git a/lighthouse-core/test/lib/minify-devtoolslog-test.js b/lighthouse-core/test/lib/minify-devtoolslog-test.js index a409dd58243b..cf9da7116114 100644 --- a/lighthouse-core/test/lib/minify-devtoolslog-test.js +++ b/lighthouse-core/test/lib/minify-devtoolslog-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {minifyDevtoolsLog} from '../../lib/minify-devtoolslog.js'; import trace from '../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/lib/minify-trace-test.js b/lighthouse-core/test/lib/minify-trace-test.js index d3298a252998..0bf1ff605fdd 100644 --- a/lighthouse-core/test/lib/minify-trace-test.js +++ b/lighthouse-core/test/lib/minify-trace-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {minifyTrace} from '../../lib/minify-trace.js'; import trace from '../fixtures/traces/progressive-app-m60.json'; diff --git a/lighthouse-core/test/lib/navigation-error-test.js b/lighthouse-core/test/lib/navigation-error-test.js index ec2f1c6d049f..c60f45838736 100644 --- a/lighthouse-core/test/lib/navigation-error-test.js +++ b/lighthouse-core/test/lib/navigation-error-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ @@ -13,7 +13,6 @@ import { getPageLoadError, getNonHtmlError, } from '../../lib/navigation-error.js'; - import NetworkRequest from '../../lib/network-request.js'; const LoadFailureMode = /** @type {const} */ ({ diff --git a/lighthouse-core/test/lib/network-recorder-test.js b/lighthouse-core/test/lib/network-recorder-test.js index 04de2382ef77..c16ecc140162 100644 --- a/lighthouse-core/test/lib/network-recorder-test.js +++ b/lighthouse-core/test/lib/network-recorder-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + + +import {strict as assert} from 'assert'; import NetworkRecorder from '../../lib/network-recorder.js'; import networkRecordsToDevtoolsLog from '../network-records-to-devtools-log.js'; -import {strict as assert} from 'assert'; import devtoolsLogItems from '../fixtures/artifacts/perflog/defaultPass.devtoolslog.json'; import prefetchedScriptDevtoolsLog from '../fixtures/prefetched-script.devtoolslog.json'; import redirectsDevtoolsLog from '../fixtures/wikipedia-redirect.devtoolslog.json'; diff --git a/lighthouse-core/test/lib/network-request-test.js b/lighthouse-core/test/lib/network-request-test.js index 01e4d2d373dc..0780a5043744 100644 --- a/lighthouse-core/test/lib/network-request-test.js +++ b/lighthouse-core/test/lib/network-request-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import NetworkRequest from '../../lib/network-request.js'; import NetworkRecorder from '../../lib/network-recorder.js'; diff --git a/lighthouse-core/test/lib/page-functions-test.js b/lighthouse-core/test/lib/page-functions-test.js index e3d4315c9c84..876b95bcfd40 100644 --- a/lighthouse-core/test/lib/page-functions-test.js +++ b/lighthouse-core/test/lib/page-functions-test.js @@ -3,10 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import assert from 'assert'; + import jsdom from 'jsdom'; + import pageFunctions from '../../lib/page-functions.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/lib/proto-preprocessor-test.js b/lighthouse-core/test/lib/proto-preprocessor-test.js index 2b93184ed1e6..dd1b17c0b38d 100644 --- a/lighthouse-core/test/lib/proto-preprocessor-test.js +++ b/lighthouse-core/test/lib/proto-preprocessor-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {getProtoRoundTrip} from '../test-utils.js'; import {processForProto} from '../../lib/proto-preprocessor.js'; diff --git a/lighthouse-core/test/lib/rect-helpers-test.js b/lighthouse-core/test/lib/rect-helpers-test.js index 4cdfcc93132f..22d832e10789 100644 --- a/lighthouse-core/test/lib/rect-helpers-test.js +++ b/lighthouse-core/test/lib/rect-helpers-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/lib/sd-validation-test.js b/lighthouse-core/test/lib/sd-validation-test.js index 4f32c833dd13..e3bf01450d0b 100644 --- a/lighthouse-core/test/lib/sd-validation-test.js +++ b/lighthouse-core/test/lib/sd-validation-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/lib/sentry-test.js b/lighthouse-core/test/lib/sentry-test.js index 420dacf2b4f0..a9e9bd3ed30c 100644 --- a/lighthouse-core/test/lib/sentry-test.js +++ b/lighthouse-core/test/lib/sentry-test.js @@ -3,11 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import {jest} from '@jest/globals'; + // import sentryNode from '@sentry/node'; import Sentry from '../../lib/sentry.js'; diff --git a/lighthouse-core/test/lib/stack-packs-test.js b/lighthouse-core/test/lib/stack-packs-test.js index d3a0d820da3f..98ffc4e1b0b6 100644 --- a/lighthouse-core/test/lib/stack-packs-test.js +++ b/lighthouse-core/test/lib/stack-packs-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/lib/statistics-test.js b/lighthouse-core/test/lib/statistics-test.js index e4359d531d23..5e6ff4107426 100644 --- a/lighthouse-core/test/lib/statistics-test.js +++ b/lighthouse-core/test/lib/statistics-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/lib/tappable-rects-test.js b/lighthouse-core/test/lib/tappable-rects-test.js index 5a2db13d0663..3fdb76f30b5d 100644 --- a/lighthouse-core/test/lib/tappable-rects-test.js +++ b/lighthouse-core/test/lib/tappable-rects-test.js @@ -3,14 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import {addRectTopAndBottom} from '../../lib/rect-helpers.js'; +import {strict as assert} from 'assert'; +import {addRectTopAndBottom} from '../../lib/rect-helpers.js'; import {getTappableRectsFromClientRects} from '../../lib/tappable-rects.js'; -import {strict as assert} from 'assert'; describe('getTappableRectsFromClientRects', () => { it('Merges rects if a smaller rect is inside a larger one', () => { diff --git a/lighthouse-core/test/lib/third-party-web-test.js b/lighthouse-core/test/lib/third-party-web-test.js index 36a429093068..94e8552534f6 100644 --- a/lighthouse-core/test/lib/third-party-web-test.js +++ b/lighthouse-core/test/lib/third-party-web-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/lib/timing-trace-saver-test.js b/lighthouse-core/test/lib/timing-trace-saver-test.js index 0d4ab05a6898..e5ca8557d1da 100644 --- a/lighthouse-core/test/lib/timing-trace-saver-test.js +++ b/lighthouse-core/test/lib/timing-trace-saver-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/lib/tracehouse/cpu-profile-model-test.js b/lighthouse-core/test/lib/tracehouse/cpu-profile-model-test.js index 6228b31a4f32..0ca89dcc482b 100644 --- a/lighthouse-core/test/lib/tracehouse/cpu-profile-model-test.js +++ b/lighthouse-core/test/lib/tracehouse/cpu-profile-model-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import CpuProfileModel from '../../../lib/tracehouse/cpu-profile-model.js'; - import TraceProcessor from '../../../lib/tracehouse/trace-processor.js'; import MainThreadTasks from '../../../lib/tracehouse/main-thread-tasks.js'; import profilerTrace from '../../fixtures/traces/cpu-profiler-m86.trace.json'; diff --git a/lighthouse-core/test/lib/tracehouse/main-thread-tasks-test.js b/lighthouse-core/test/lib/tracehouse/main-thread-tasks-test.js index 513c1459d779..96a5dc4bc9a4 100644 --- a/lighthouse-core/test/lib/tracehouse/main-thread-tasks-test.js +++ b/lighthouse-core/test/lib/tracehouse/main-thread-tasks-test.js @@ -3,18 +3,18 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import MainThreadTasks from '../../../lib/tracehouse/main-thread-tasks.js'; +import {strict as assert} from 'assert'; +import MainThreadTasks from '../../../lib/tracehouse/main-thread-tasks.js'; import TraceProcessor from '../../../lib/tracehouse/trace-processor.js'; import {taskGroups} from '../../../lib/tracehouse/task-groups.js'; import pwaTrace from '../../fixtures/traces/progressive-app.json'; import noTracingStartedTrace from '../../fixtures/traces/no-tracingstarted-m74.json'; import TracingProcessor from '../../../lib/tracehouse/trace-processor.js'; -import {strict as assert} from 'assert'; describe('Main Thread Tasks', () => { const pid = 1; diff --git a/lighthouse-core/test/lib/tracehouse/trace-processor-test.js b/lighthouse-core/test/lib/tracehouse/trace-processor-test.js index ce07127cf05c..9b471e4ef3f9 100644 --- a/lighthouse-core/test/lib/tracehouse/trace-processor-test.js +++ b/lighthouse-core/test/lib/tracehouse/trace-processor-test.js @@ -3,12 +3,12 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import TraceProcessor from '../../../lib/tracehouse/trace-processor.js'; + import {strict as assert} from 'assert'; -import createTestTrace from '../../create-test-trace.js'; +import TraceProcessor from '../../../lib/tracehouse/trace-processor.js'; +import createTestTrace from '../../create-test-trace.js'; import pwaTrace from '../../fixtures/traces/progressive-app.json'; import badNavStartTrace from '../../fixtures/traces/bad-nav-start-ts.json'; import lateTracingStartedTrace from '../../fixtures/traces/tracingstarted-after-navstart.json'; diff --git a/lighthouse-core/test/lib/traces/pwmetrics-events-test.js b/lighthouse-core/test/lib/traces/pwmetrics-events-test.js index 8d826a97286e..8f177af9d437 100644 --- a/lighthouse-core/test/lib/traces/pwmetrics-events-test.js +++ b/lighthouse-core/test/lib/traces/pwmetrics-events-test.js @@ -3,10 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; -import Metrics from '../../../lib/traces/pwmetrics-events.js'; + import {strict as assert} from 'assert'; + +import Metrics from '../../../lib/traces/pwmetrics-events.js'; import dbwTrace from '../../results/artifacts/defaultPass.trace.json'; import dbwResults from '../../results/sample_v2.json'; diff --git a/lighthouse-core/test/lib/url-shim-test.js b/lighthouse-core/test/lib/url-shim-test.js index 0d7a53d07d76..992087665f09 100644 --- a/lighthouse-core/test/lib/url-shim-test.js +++ b/lighthouse-core/test/lib/url-shim-test.js @@ -3,13 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import {strict as assert} from 'assert'; + import URL from '../../lib/url-shim.js'; -import {strict as assert} from 'assert'; const superLongName = 'https://example.com/thisIsASuperLongURLThatWillTriggerFilenameTruncationWhichWeWantToTest.js'; diff --git a/lighthouse-core/test/network-records-to-devtools-log-test.js b/lighthouse-core/test/network-records-to-devtools-log-test.js index 77d3f4db67e3..55bfda1a3c3a 100644 --- a/lighthouse-core/test/network-records-to-devtools-log-test.js +++ b/lighthouse-core/test/network-records-to-devtools-log-test.js @@ -3,12 +3,11 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ import NetworkRecorder from '../../lighthouse-core/lib/network-recorder.js'; - import networkRecordsToDevtoolsLog from './network-records-to-devtools-log.js'; import lcpDevtoolsLog from './fixtures/traces/lcp-m78.devtools.log.json'; diff --git a/lighthouse-core/test/network-records-to-devtools-log.js b/lighthouse-core/test/network-records-to-devtools-log.js index afe771f55e35..323be9bedeea 100644 --- a/lighthouse-core/test/network-records-to-devtools-log.js +++ b/lighthouse-core/test/network-records-to-devtools-log.js @@ -4,7 +4,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import NetworkRecorder from '../../lighthouse-core/lib/network-recorder.js'; /** @typedef {import('../../lighthouse-core/lib/network-request.js')} NetworkRequest */ diff --git a/lighthouse-core/test/results/sample-config.js b/lighthouse-core/test/results/sample-config.js index 4cafba6eb6b0..50dad38cd280 100644 --- a/lighthouse-core/test/results/sample-config.js +++ b/lighthouse-core/test/results/sample-config.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /** * @fileoverview Config used for generating the sample_v2 golden LHR. diff --git a/lighthouse-core/test/runner-test.js b/lighthouse-core/test/runner-test.js index 0c52ec7b81ed..8cc0110c535a 100644 --- a/lighthouse-core/test/runner-test.js +++ b/lighthouse-core/test/runner-test.js @@ -3,11 +3,16 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ +import fs from 'fs'; +import {strict as assert} from 'assert'; +import path from 'path'; + import {jest} from '@jest/globals'; + // import Runner from '../runner.js'; // import GatherRunner from '../gather/gather-runner.js'; import driverMock from './gather/fake-driver.js'; @@ -15,9 +20,6 @@ import driverMock from './gather/fake-driver.js'; import Audit from '../audits/audit.js'; import Gatherer from '../gather/gatherers/gatherer.js'; import assetSaver from '../lib/asset-saver.js'; -import fs from 'fs'; -import {strict as assert} from 'assert'; -import path from 'path'; import LHError from '../lib/lh-error.js'; import i18n from '../lib/i18n/i18n.js'; import {makeMocksForGatherRunner} from './test-utils.js'; diff --git a/lighthouse-core/test/sample-json-test.js b/lighthouse-core/test/sample-json-test.js index 668504460999..b8b354d8b6fd 100644 --- a/lighthouse-core/test/sample-json-test.js +++ b/lighthouse-core/test/sample-json-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/scoring-test.js b/lighthouse-core/test/scoring-test.js index 30ac3fb9730d..738d109cda56 100644 --- a/lighthouse-core/test/scoring-test.js +++ b/lighthouse-core/test/scoring-test.js @@ -3,9 +3,10 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import {strict as assert} from 'assert'; + import ReportScoring from '../scoring.js'; /* eslint-env jest */ diff --git a/lighthouse-core/test/scripts/i18n/bake-ctc-to-lhl-test.js b/lighthouse-core/test/scripts/i18n/bake-ctc-to-lhl-test.js index e232341507fe..2f9723347abd 100644 --- a/lighthouse-core/test/scripts/i18n/bake-ctc-to-lhl-test.js +++ b/lighthouse-core/test/scripts/i18n/bake-ctc-to-lhl-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/scripts/i18n/collect-strings-test.js b/lighthouse-core/test/scripts/i18n/collect-strings-test.js index 85dfdbb74e93..363e3482072d 100644 --- a/lighthouse-core/test/scripts/i18n/collect-strings-test.js +++ b/lighthouse-core/test/scripts/i18n/collect-strings-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/scripts/i18n/prune-obsolete-lhl-messages-test.js b/lighthouse-core/test/scripts/i18n/prune-obsolete-lhl-messages-test.js index ac4fd8f66b5d..cb9f21c4f51f 100644 --- a/lighthouse-core/test/scripts/i18n/prune-obsolete-lhl-messages-test.js +++ b/lighthouse-core/test/scripts/i18n/prune-obsolete-lhl-messages-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ diff --git a/lighthouse-core/test/scripts/lantern/constants-test.js b/lighthouse-core/test/scripts/lantern/constants-test.js index 0d15a975a839..ca64c413a4ea 100644 --- a/lighthouse-core/test/scripts/lantern/constants-test.js +++ b/lighthouse-core/test/scripts/lantern/constants-test.js @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + import constants from '../../../scripts/lantern/constants.js'; diff --git a/lighthouse-core/test/test-utils.js b/lighthouse-core/test/test-utils.js index 85cb33f0eb2f..227c9536e069 100644 --- a/lighthouse-core/test/test-utils.js +++ b/lighthouse-core/test/test-utils.js @@ -3,12 +3,14 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * 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. */ -'use strict'; + /* eslint-env jest */ -import {jest} from '@jest/globals'; import fs from 'fs'; + +import {jest} from '@jest/globals'; + import {LH_ROOT} from '../../root.js'; import {createCommonjsRefs} from '../scripts/esm-utils.js'; import * as mockCommands from './gather/mock-commands.js'; From 097827dc02f7886180cf3bb4ea92e64d5b64e3de Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Wed, 4 May 2022 09:10:05 -0700 Subject: [PATCH 2/4] tests: fix unconverted test --- .../experimental-interaction-to-next-paint-test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lighthouse-core/test/audits/metrics/experimental-interaction-to-next-paint-test.js b/lighthouse-core/test/audits/metrics/experimental-interaction-to-next-paint-test.js index 53c000f3d8e5..a8f218240527 100644 --- a/lighthouse-core/test/audits/metrics/experimental-interaction-to-next-paint-test.js +++ b/lighthouse-core/test/audits/metrics/experimental-interaction-to-next-paint-test.js @@ -5,10 +5,10 @@ */ 'use strict'; -const ExperimentalInteractionToNextPaint = - require('../../../audits/metrics/experimental-interaction-to-next-paint.js'); -const interactionTrace = require('../../fixtures/traces/timespan-responsiveness-m103.trace.json'); -const noInteractionTrace = require('../../fixtures/traces/jumpy-cls-m90.json'); +import ExperimentalInteractionToNextPaint from + '../../../audits/metrics/experimental-interaction-to-next-paint.js'; +import interactionTrace from '../../fixtures/traces/timespan-responsiveness-m103.trace.json'; +import noInteractionTrace from '../../fixtures/traces/jumpy-cls-m90.json'; /* eslint-env jest */ From 974a4581f0e5822e7a20e5196fd988d203635b4d Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Wed, 4 May 2022 09:24:58 -0700 Subject: [PATCH 3/4] lol --- .../test/computed/metrics/responsiveness-test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lighthouse-core/test/computed/metrics/responsiveness-test.js b/lighthouse-core/test/computed/metrics/responsiveness-test.js index 93aaace17901..0cc239978cb9 100644 --- a/lighthouse-core/test/computed/metrics/responsiveness-test.js +++ b/lighthouse-core/test/computed/metrics/responsiveness-test.js @@ -5,13 +5,13 @@ */ 'use strict'; -const assert = require('assert').strict; +import {strict as assert} from 'assert'; -const Responsiveness = require('../../../computed/metrics/responsiveness.js'); -const createTestTrace = require('../../create-test-trace.js'); +import Responsiveness from '../../../computed/metrics/responsiveness.js'; +import createTestTrace from '../../create-test-trace.js'; -const interactionTrace = require('../../fixtures/traces/timespan-responsiveness-m103.trace.json'); -const noInteractionTrace = require('../../fixtures/traces/frame-metrics-m89.json'); +import interactionTrace from '../../fixtures/traces/timespan-responsiveness-m103.trace.json'; +import noInteractionTrace from '../../fixtures/traces/frame-metrics-m89.json'; /* eslint-env jest */ From fbb2db23f59672f8a07d695487b83b6d09ef8f78 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Wed, 4 May 2022 09:32:01 -0700 Subject: [PATCH 4/4] ok --- lighthouse-core/test/computed/metrics/responsiveness-test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lighthouse-core/test/computed/metrics/responsiveness-test.js b/lighthouse-core/test/computed/metrics/responsiveness-test.js index 1797332fb8c7..8dc9d9064f2e 100644 --- a/lighthouse-core/test/computed/metrics/responsiveness-test.js +++ b/lighthouse-core/test/computed/metrics/responsiveness-test.js @@ -4,7 +4,6 @@ * 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 {strict as assert} from 'assert'; import Responsiveness from '../../../computed/metrics/responsiveness.js';