forked from checkinholiday/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript-elements-test-audit.js
29 lines (27 loc) · 1.18 KB
/
script-elements-test-audit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview This is a fake audit used exclusively in smoke tests to force inclusion of ScriptElements artifact.
* It is included here for complex reasons in the way the bundled smoketests work.
*
* The smokehouse configs are evaluated first in the node CLI side (which requires an absolute path using LH_ROOT).
* The smokehouse configs are then *re-evaluated* in the bundled context for execution by Lighthouse (which *cannot* use an absolute path using LH_ROOT).
*
* This mismatch in environment demands that the audit path in the config must be context-aware,
* yet the require-graph for the config is included before even the CLI knows that it will be using
* a bundled runner. Rather than force a massive smoketest architecture change, we include a harmless,
* test-only audit in our core list instead.
*/
export default {
meta: {
id: 'script-elements-test-audit',
title: 'ScriptElements',
failureTitle: 'ScriptElements',
description: 'Audit to force the inclusion of ScriptElements artifact',
requiredArtifacts: ['ScriptElements'],
},
audit: () => ({score: 1}),
};