lighthouse 9.5.0-dev.20230111 → 9.5.0-dev.20230112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/bin.js +6 -6
- package/cli/run.js +1 -1
- package/cli/test/smokehouse/lighthouse-runners/bundle.js +9 -9
- package/cli/test/smokehouse/lighthouse-runners/cli.js +7 -7
- package/cli/test/smokehouse/lighthouse-runners/devtools.js +3 -3
- package/cli/test/smokehouse/readme.md +1 -1
- package/cli/test/smokehouse/smokehouse.js +13 -13
- package/core/audits/seo/is-crawlable.js +114 -42
- package/core/config/config-helpers.js +11 -11
- package/core/config/config-plugin.js +2 -2
- package/core/config/config.js +15 -15
- package/core/config/default-config.js +2 -2
- package/core/config/desktop-config.js +1 -1
- package/core/config/experimental-config.js +1 -1
- package/core/config/full-config.js +1 -1
- package/core/config/lr-desktop-config.js +1 -1
- package/core/config/lr-mobile-config.js +1 -1
- package/core/config/perf-config.js +1 -1
- package/core/config/validation.js +4 -4
- package/core/gather/navigation-runner.js +1 -1
- package/core/gather/snapshot-runner.js +1 -1
- package/core/gather/timespan-runner.js +1 -1
- package/core/index.js +10 -10
- package/core/legacy/config/config.js +23 -23
- package/core/legacy/config/legacy-default-config.js +1 -1
- package/core/user-flow.js +3 -3
- package/core/util.cjs +13 -3
- package/dist/report/bundle.esm.js +13 -3
- package/dist/report/flow.js +1 -1
- package/dist/report/standalone.js +1 -1
- package/package.json +1 -1
- package/report/renderer/util.js +13 -3
- package/report/test/generator/report-generator-test.js +1 -1
- package/report/test/renderer/util-test.js +2 -0
- package/types/config.d.ts +18 -18
- package/types/smokehouse.d.ts +2 -2
- package/types/user-flow.d.ts +1 -1
package/report/renderer/util.js
CHANGED
|
@@ -512,14 +512,24 @@ class Util {
|
|
|
512
512
|
summary = cpuThrottling = networkThrottling = Util.i18n.strings.runtimeUnknown;
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
+
// devtools-entry.js always sets `screenEmulation.disabled` when using mobile emulation,
|
|
516
|
+
// because we handle the emulation outside of Lighthouse. Since the screen truly is emulated
|
|
517
|
+
// as a mobile device, ignore `.disabled` in devtools and just check the form factor
|
|
518
|
+
const isScreenEmulationDisabled = settings.channel === 'devtools' ?
|
|
519
|
+
false :
|
|
520
|
+
settings.screenEmulation.disabled;
|
|
521
|
+
const isScreenEmulationMobile = settings.channel === 'devtools' ?
|
|
522
|
+
settings.formFactor === 'mobile' :
|
|
523
|
+
settings.screenEmulation.mobile;
|
|
524
|
+
|
|
515
525
|
let deviceEmulation = Util.i18n.strings.runtimeMobileEmulation;
|
|
516
|
-
if (
|
|
526
|
+
if (isScreenEmulationDisabled) {
|
|
517
527
|
deviceEmulation = Util.i18n.strings.runtimeNoEmulation;
|
|
518
|
-
} else if (!
|
|
528
|
+
} else if (!isScreenEmulationMobile) {
|
|
519
529
|
deviceEmulation = Util.i18n.strings.runtimeDesktopEmulation;
|
|
520
530
|
}
|
|
521
531
|
|
|
522
|
-
const screenEmulation =
|
|
532
|
+
const screenEmulation = isScreenEmulationDisabled ?
|
|
523
533
|
undefined :
|
|
524
534
|
// eslint-disable-next-line max-len
|
|
525
535
|
`${settings.screenEmulation.width}x${settings.screenEmulation.height}, DPR ${settings.screenEmulation.deviceScaleFactor}`;
|
|
@@ -37,8 +37,10 @@ describe('util helpers', () => {
|
|
|
37
37
|
/* eslint-disable max-len */
|
|
38
38
|
assert.equal(get({formFactor: 'mobile', screenEmulation: {disabled: false, mobile: true}}), 'Emulated Moto G4');
|
|
39
39
|
assert.equal(get({formFactor: 'mobile', screenEmulation: {disabled: true, mobile: true}}), 'No emulation');
|
|
40
|
+
assert.equal(get({formFactor: 'mobile', screenEmulation: {disabled: true, mobile: true}, channel: 'devtools'}), 'Emulated Moto G4');
|
|
40
41
|
assert.equal(get({formFactor: 'desktop', screenEmulation: {disabled: false, mobile: false}}), 'Emulated Desktop');
|
|
41
42
|
assert.equal(get({formFactor: 'desktop', screenEmulation: {disabled: true, mobile: false}}), 'No emulation');
|
|
43
|
+
assert.equal(get({formFactor: 'desktop', screenEmulation: {disabled: true, mobile: true}, channel: 'devtools'}), 'Emulated Desktop');
|
|
42
44
|
/* eslint-enable max-len */
|
|
43
45
|
});
|
|
44
46
|
|
package/types/config.d.ts
CHANGED
|
@@ -14,25 +14,25 @@ interface ClassOf<T> {
|
|
|
14
14
|
new (): T;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
17
|
+
/**
|
|
18
|
+
* The Lighthouse Config format.
|
|
19
|
+
*/
|
|
20
|
+
interface Config {
|
|
21
|
+
extends?: 'lighthouse:default' | string;
|
|
22
|
+
settings?: SharedFlagsSettings;
|
|
23
|
+
audits?: Config.AuditJson[] | null;
|
|
24
|
+
categories?: Record<string, Config.CategoryJson> | null;
|
|
25
|
+
groups?: Record<string, Config.GroupJson> | null;
|
|
26
|
+
plugins?: Array<string>;
|
|
27
|
+
|
|
28
|
+
// Fraggle Rock Only
|
|
29
|
+
artifacts?: Config.ArtifactJson[] | null;
|
|
30
|
+
|
|
31
|
+
// Legacy Only
|
|
32
|
+
passes?: Config.PassJson[] | null;
|
|
33
|
+
}
|
|
35
34
|
|
|
35
|
+
declare module Config {
|
|
36
36
|
/**
|
|
37
37
|
* The normalized and fully resolved legacy config.
|
|
38
38
|
*/
|
package/types/smokehouse.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ declare global {
|
|
|
37
37
|
/** Expected test results. */
|
|
38
38
|
expectations: ExpectedRunnerResult;
|
|
39
39
|
/** An optional custom config. If none is present, uses the default Lighthouse config. */
|
|
40
|
-
config?: Config
|
|
40
|
+
config?: Config;
|
|
41
41
|
/** If test is performance sensitive, set to true so that it won't be run parallel to other tests. */
|
|
42
42
|
runSerially?: boolean;
|
|
43
43
|
}
|
|
@@ -52,7 +52,7 @@ declare global {
|
|
|
52
52
|
{expectations: Smokehouse.ExpectedRunnerResult | Array<Smokehouse.ExpectedRunnerResult>}
|
|
53
53
|
|
|
54
54
|
export type LighthouseRunner =
|
|
55
|
-
{runnerName?: string} & ((url: string,
|
|
55
|
+
{runnerName?: string} & ((url: string, config?: Config, runnerOptions?: {isDebug?: boolean; useLegacyNavigation?: boolean}) => Promise<{lhr: LHResult, artifacts: Artifacts, log: string}>);
|
|
56
56
|
|
|
57
57
|
export interface SmokehouseOptions {
|
|
58
58
|
/** If true, performs extra logging from the test runs. */
|
package/types/user-flow.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare module UserFlow {
|
|
|
8
8
|
|
|
9
9
|
export interface Options {
|
|
10
10
|
/** Config to use for each flow step. */
|
|
11
|
-
config?: LH.Config
|
|
11
|
+
config?: LH.Config;
|
|
12
12
|
/** Base flags to use for each flow step. Step specific flags will override these flags. */
|
|
13
13
|
flags?: LH.Flags;
|
|
14
14
|
/** Display name for this user flow. */
|