lighthouse 11.1.0-dev.20230917 → 11.1.0-dev.20230918

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.
@@ -1,4 +1,3 @@
1
- export type ChildProcessError = import('./lib/child-process-error.js').ChildProcessError;
2
1
  export type Run = {
3
2
  networkRequests: string[] | undefined;
4
3
  lhr: LH.Result;
@@ -12,8 +12,6 @@
12
12
 
13
13
  /* eslint-disable no-console */
14
14
 
15
- /** @typedef {import('./lib/child-process-error.js').ChildProcessError} ChildProcessError */
16
-
17
15
  /**
18
16
  * @typedef Run
19
17
  * @property {string[] | undefined} networkRequests
@@ -39,6 +37,7 @@ import {runLighthouse as cliLighthouseRunner} from './lighthouse-runners/cli.js'
39
37
  import {getAssertionReport} from './report-assert.js';
40
38
  import {LocalConsole} from './lib/local-console.js';
41
39
  import {ConcurrentMapper} from './lib/concurrent-mapper.js';
40
+ import {ChildProcessError} from './lib/child-process-error.js';
42
41
 
43
42
  // The number of concurrent (`!runSerially`) tests to run if `jobs` isn't set.
44
43
  const DEFAULT_CONCURRENT_RUNS = 5;
@@ -239,11 +238,18 @@ async function runSmokeTest(smokeTestDefn, testOptions) {
239
238
  * @param {ChildProcessError|Error} err
240
239
  */
241
240
  function logChildProcessError(localConsole, err) {
242
- if ('stdout' in err && 'stderr' in err) {
241
+ if (err instanceof ChildProcessError) {
243
242
  localConsole.adoptStdStrings(err);
244
243
  }
245
244
 
246
245
  localConsole.log(log.redify(err.stack || err.message));
246
+ if (err.cause) {
247
+ if (err.cause instanceof Error) {
248
+ localConsole.log(log.redify(`[cause] ${err.cause.stack || err.cause.message}`));
249
+ } else {
250
+ localConsole.log(log.redify(`[cause] ${err.cause}`));
251
+ }
252
+ }
247
253
  }
248
254
 
249
255
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "11.1.0-dev.20230917",
4
+ "version": "11.1.0-dev.20230918",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./core/index.js",
7
7
  "bin": {