Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 17acca7

Browse files
committedOct 16, 2019
docs: update assertions docs for new functionality
1 parent 13c687e commit 17acca7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
 

‎docs/assertions.md

+27
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ The result of any audit in Lighthouse can be asserted. Assertions are keyed by t
3131
}
3232
```
3333

34+
### Categories
35+
36+
The score of any category in Lighthouse can also be asserted. Assertions are keyed by `categories.<categoryId>` and follow the same eslint-style format as audit assertions.
37+
38+
```json
39+
{
40+
"assertions": {
41+
"categories.pwa": "off",
42+
"categories.accessibility": ["error", {"this-is-an-options-object": true}]
43+
}
44+
}
45+
```
46+
3447
### Levels
3548

3649
There are three Lighthouse CI assertion levels.
@@ -114,3 +127,17 @@ Instead of configuring using Lighthouse CI assertions against Lighthouse audits,
114127
"budgetsFile": "path/from/cwd/to/budget.json"
115128
}
116129
```
130+
131+
If you'd like to consolidate multiple assertion configuration files and avoid multiple calls to `lhci assert`, you can also configure your budgets alongside your other Lighthouse CI assertions instead. Budget assertions follow the form `resource-summary.<resourceType>.(size|count)`.
132+
133+
```json
134+
{
135+
"assertions": {
136+
"audit-id-1": ["warn", {"maxNumericValue": 4000}],
137+
"audit-id-2": ["error", {"minScore": 0.8}],
138+
"resource-summary.document.size": ["error", {"maxNumericValue": 400}],
139+
"resource-summary.font.count": ["warn", {"maxNumericValue": 1}],
140+
"resource-summary.third-party.count": ["warn", {"maxNumericValue": 5}]
141+
}
142+
}
143+
```

0 commit comments

Comments
 (0)
Please sign in to comment.