Questions on Assert Behaviour
See original GitHub issueThe assert configuration is as below
"assert": {
"preset": "lighthouse:no-pwa",
"assertions": {
"categories:performance": ["warn", {"aggregationMethod": "optimistic", "minScore": 0.70}],
"categories:accessibility": ["warn", {"aggregationMethod": "optimistic", "minScore": 0.90}]
}
}
and from the Assertion Levels docs
If an audit is not found in the assertions object, it is assumed to be off. The audit result will not be checked.
Yet, when I run lhci assert I get the below output.
× unused-css-rules failure for maxLength assertion
Remove unused CSS
Documentation: https://web.dev/unused-css-rules
expected: <=0
found: 1
all values: 1, 1, 1
× uses-optimized-images failure for maxLength assertion
Efficiently encode images
Documentation: https://web.dev/uses-optimized-images
expected: <=0
found: 1
all values: 1, 1, 1
× uses-responsive-images failure for maxLength assertion
Properly size images
Documentation: https://web.dev/uses-responsive-images
expected: <=0
found: 1
all values: 1, 1, 1
⚠️ render-blocking-resources warning for maxLength assertion
Eliminate render-blocking resources
Documentation: https://web.dev/render-blocking-resources
expected: <=0
found: 2
all values: 2, 2, 2
⚠️ uses-long-cache-ttl warning for maxLength assertion
Serve static assets with an efficient cache policy
Documentation: https://web.dev/uses-long-cache-ttl
expected: <=0
found: 7
all values: 7, 7, 7
⚠️ uses-webp-images warning for maxLength assertion
Serve images in next-gen formats
Documentation: https://web.dev/uses-webp-images
expected: <=0
found: 1
all values: 1, 1, 1
Assertion failed. Exiting with status code 1.
What I expected to happen ? That these rules are not checked because they are not in the assertion object and more importantly that the assertion result does not fail because of this.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
Assertions, Questions, Answers & the Common Ground
If settling answers to polar questions count as assertions, what do they assert? Presumably, a to...
Read more >Programming With Assertions - Oracle Help Center
An assertion is a statement in the Java programming language that enables you to test your assumptions about your program. For example, if...
Read more >Python's assert: Debug and Test Your Code Like a Pro
In this tutorial, you'll learn how to use Python's assert statement to document, debug, and test code in development.
Read more >Assert behaviour in java? - Stack Overflow
The docs are clear: Expression2 is an expression that has a value. (It cannot be an invocation of a method that is declared...
Read more >Assert and Verify Methods in Selenium | BrowserStack
Assertions (also known as Asserts) ... The word Assert means to state a fact or belief confidently or forcefully. In Selenium, Asserts are ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for filing @GuruCharan94! It’s failing because you’re using the preset
lighthouse:no-pwa
which has assertions on all of the non-pwa audits. If you don’t want to extend a preset and just have your assertions run, eliminate thepreset
property from your config.But you just told me your configuration was
so you’re using a preset and it wasn’t done.