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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e47d9c8b9ac4ff8fe209317f9054fafd3c5d7c81f1f241cb61be6035940ea50a
4
- data.tar.gz: 6627e960001bad68703a9a0d5eb2a20691f97f137b8293fcd24f70813c1df6d9
3
+ metadata.gz: 13b0c2fb40335271d04162ba9302b8f8601a294d6c8c26b6e904322013daf227
4
+ data.tar.gz: 891fa3772857cb424f555b49985347867b2ab89560e5fa3c5992fe689e8d49ed
5
5
  SHA512:
6
- metadata.gz: 2628e449c6d825aea0eed45bfbd2a3e9f3c63d925495033003f4c3eae649a6a4686f72ca90e388e61131aacd893a491733ed23b4762698b21bfd8c31ef7cbb04
7
- data.tar.gz: 6da50b69d8d31d21ab669c3b7e1de4d74f731af703d9bae63ee8082836fa6be0a92d53bf1a64bef0bcf21c2598edaef58f6b153f3c716da3fe3a45f753f78a26
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.3.0)
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.3.9)
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lighthouse
4
4
  module Matchers
5
- VERSION = '1.3.0'
5
+ VERSION = '1.4.0'
6
6
  end
7
7
  end
@@ -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.3.0
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-08-12 00:00:00.000000000 Z
11
+ date: 2025-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler