jscov 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f82380fb241d12d3d6eebe7d3e8871b27cabb321616e512b98b5608e59bfb0cc
4
- data.tar.gz: 45bee86b0495527eb965828c79142572e26c0010e2b983d870cecf6d61cc4e27
3
+ metadata.gz: a5f6448f50d082e6d9ef6e8e74d8887a3f7e7c0cf1d3241134dbbca15030eb9b
4
+ data.tar.gz: dd84c1191c0a7bd3556e60244cc9f29b317b09d72eff52fab458309e6eb3cb46
5
5
  SHA512:
6
- metadata.gz: 22683961b04ade60df6a5a8511cfba794370e81476b55518b049b7ab75d5fba1fa530039cdb8e6aa8d7baba99d5e65ab5e4599d46d01bd3661857b5b34c8d092
7
- data.tar.gz: 0436e397fc6250f3e3430b0c12a0cd4afa20db53d4596dd47896e59106615dd71b86a64a5700a1f312b5e85cdcc89e080a8813d34c9dc2dc282cf3b6116209c0
6
+ metadata.gz: 21df5f4ab063f0010bf931947865e77336453f5d95de0e36d4a39efdec9ec479f2f38bcae69f9beba0f76959c8e5c672aeae2f50d02715e13e375aa420f43b6a
7
+ data.tar.gz: ea20b192571cce145769f71ce8634b5591e50f2f67ff864046cc65efa28ee963a90b162d47af513369322746b5b547845c84aefc8d66161289d067845910b181
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/jscov.svg)](http://badge.fury.io/rb/jscov)
2
- [![Build Status](https://travis-ci.org/kzkn/jscov.svg?branch=master)](https://travis-ci.org/kzkn/jscov)
2
+ ![](https://github.com/kzkn/jscov/workflows/CI/badge.svg)
3
3
 
4
4
  # Jscov
5
5
 
@@ -66,10 +66,9 @@ Configure selenium to capture the output of `console.log`:
66
66
  RSpec.configure do |config|
67
67
  config.before(type: :system) do
68
68
  caps = Selenium::WebDriver::Remote::Capabilities.chrome(
69
- 'chromeOptions' => { w3c: false },
70
69
  'goog:loggingPrefs' => { browser: 'ALL' }
71
70
  )
72
- driven_by :selenium, using: :headless_chrome, options: { desired_capabilities: caps }
71
+ driven_by :selenium, using: :headless_chrome, options: { capabilities: caps }
73
72
  end
74
73
  end
75
74
  ```
@@ -104,7 +103,7 @@ Selenium's `logs.get(:browser)` is a destructive method. `jscov` depends on it.
104
103
  You can pass browser logs to `Jscov.save!` to avoid this issue:
105
104
 
106
105
  ```ruby
107
- logs = Capybara.current_session.driver.browser.manage.logs.get(:browser)
106
+ logs = Capybara.current_session.driver.browser.logs.get(:browser)
108
107
  Jscov.save!(logs: logs)
109
108
  ```
110
109
 
@@ -154,5 +153,9 @@ Jscov.configure do |config|
154
153
  end
155
154
  ```
156
155
 
156
+ ## Contributing
157
+
158
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kzkn/jscov.
159
+
157
160
  ## License
158
161
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -9,7 +9,7 @@ module Jscov
9
9
  end
10
10
 
11
11
  def coverages
12
- return [] unless selenium?
12
+ return [] unless supported_driver?
13
13
 
14
14
  dump_coverage
15
15
 
@@ -19,8 +19,9 @@ module Jscov
19
19
  .map { |cov| Coverage.new(cov) }
20
20
  end
21
21
 
22
- def selenium?
23
- @session.driver.browser.respond_to?(:manage)
22
+ def supported_driver?
23
+ @session.driver.is_a?(Capybara::Selenium::Driver) &&
24
+ @session.driver.browser.respond_to?(:logs)
24
25
  end
25
26
 
26
27
  def dump_coverage
@@ -31,7 +32,7 @@ module Jscov
31
32
  end
32
33
 
33
34
  def browser_logs
34
- logs = @session.driver.browser.manage.logs.get(:browser)
35
+ logs = @session.driver.browser.logs.get(:browser)
35
36
  (@logs || []) + logs
36
37
  end
37
38
 
data/lib/jscov/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jscov
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jscov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuki Nishikawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-24 00:00:00.000000000 Z
11
+ date: 2021-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -39,21 +39,21 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: selenium-webdriver
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
47
+ version: '4.0'
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '4.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: webdrivers
56
+ name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: selenium-webdriver
70
+ name: webdrivers
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  requirements: []
140
- rubygems_version: 3.0.3
140
+ rubygems_version: 3.2.3
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Collect JavaScript code coverages.