lighthouse-matchers 1.3.0 → 1.4.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +5 -0
- data/lib/lighthouse/audit_service.rb +4 -0
- data/lib/lighthouse/matchers/version.rb +1 -1
- data/lib/lighthouse/matchers.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13b0c2fb40335271d04162ba9302b8f8601a294d6c8c26b6e904322013daf227
|
4
|
+
data.tar.gz: 891fa3772857cb424f555b49985347867b2ab89560e5fa3c5992fe689e8d49ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58d574c6e7bce9e98fac696113867807615e996d1c564520c276a5eb296fa76d83e6c1714d63a6a6fae4008549c896215e87562535dbcdd7a5194a9bc592e7e2
|
7
|
+
data.tar.gz: f24d482030024f6bb8a20d9b679cdcad500b892097e7d6b95fa1c6ea0b0d8c2c6c248d0a1ab7913f903a0886c5cec06aa8bc79871b01bb43f1eb7fcb630f0f85
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.4.0] - 2025-09-17
|
10
|
+
### Added
|
11
|
+
- Added config options for "preset" and "form-factor" so those parameters can be passed to the `lighthouse` command ([#71](https://github.com/ackama/lighthouse-matchers/pull/71))
|
12
|
+
|
9
13
|
## [1.3.0] - 2025-08-13
|
10
14
|
### Added
|
11
15
|
- Write audit results to disk on failure so they can be viewed using the browser viewer ([#68](https://github.com/ackama/lighthouse-matchers/pull/68))
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lighthouse-matchers (1.
|
4
|
+
lighthouse-matchers (1.4.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
rainbow (3.0.0)
|
15
15
|
rake (13.0.1)
|
16
16
|
regexp_parser (2.2.0)
|
17
|
-
rexml (3.
|
17
|
+
rexml (3.4.2)
|
18
18
|
rspec (3.8.0)
|
19
19
|
rspec-core (~> 3.8.0)
|
20
20
|
rspec-expectations (~> 3.8.0)
|
data/README.md
CHANGED
@@ -102,6 +102,11 @@ All configuration keys are accessible against the `Lighthouse::Matchers` object.
|
|
102
102
|
for the CLI. This setting can be used if the Lighthouse tool is installed in a non-standard location.
|
103
103
|
* **`minimum_score`:** The default minimum score that audits must meet for the matcher to pass.
|
104
104
|
The default value of this configuration setting is '100' - e.g. audits must fully comply to pass.
|
105
|
+
* **`preset`:** The built-in configuration that will be used by Lighthouse CLI if defined
|
106
|
+
Options: "perf", "experimental", "desktop"
|
107
|
+
* **`form_factor`:** If defined, this value changes how performance metrics are measured and whether mobile only checks are performed
|
108
|
+
If you are intending to run lighthouse to only test the desktop version of your site, it is recommended that you use preset instead.
|
109
|
+
Options: "desktop", "mobile"
|
105
110
|
* **`chrome_flags`:** Any additional flags that should be passed to Chrome when Lighthouse launches a browser instance. As an example, running Lighthouse in Docker requires the normal headless Chrome flags (`--headless`, `--no-sandbox`) for Chrome to successfully start. Chrome flags can either be specified as an array (`["headless", "no-sandbox"]`) or as a string (`--headless --no-sandbox`).
|
106
111
|
* **`results_directory`:** Directory to write lighthouse results on failure
|
107
112
|
* Defaults to `<RSpec.configuration.default_path>/lighthouse` if `RSpec` is defined, otherwise a temporary directory prefixed with `lighthouse-matchers-`
|
@@ -15,6 +15,8 @@ class AuditService
|
|
15
15
|
@runner = Lighthouse::Matchers.runner
|
16
16
|
@cmd = Lighthouse::Matchers.lighthouse_cli
|
17
17
|
@chrome_flags = Lighthouse::Matchers.chrome_flags
|
18
|
+
@preset = Lighthouse::Matchers.preset
|
19
|
+
@form_factor = Lighthouse::Matchers.form_factor
|
18
20
|
end
|
19
21
|
|
20
22
|
def passing_score?
|
@@ -52,6 +54,8 @@ class AuditService
|
|
52
54
|
builder << " --only-categories=#{@audit}"
|
53
55
|
builder << " --port=#{@port}" if @port
|
54
56
|
builder << " --chrome-flags='#{@chrome_flags}'" if @chrome_flags
|
57
|
+
builder << " --preset=#{@preset}" if @preset
|
58
|
+
builder << " --form-factor=#{@form_factor}" if @form_factor
|
55
59
|
end.strip
|
56
60
|
end
|
57
61
|
|
data/lib/lighthouse/matchers.rb
CHANGED
@@ -10,7 +10,7 @@ module Lighthouse
|
|
10
10
|
class Error < StandardError; end
|
11
11
|
class << self
|
12
12
|
attr_writer :minimum_score, :lighthouse_cli, :runner, :chrome_flags, :results_directory
|
13
|
-
attr_accessor :remote_debugging_port
|
13
|
+
attr_accessor :remote_debugging_port, :preset, :form_factor
|
14
14
|
|
15
15
|
def minimum_score
|
16
16
|
@minimum_score ||= default_minimum_score
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lighthouse-matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh McArthur on behalf of Ackama
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|