guard-jasmine 1.18.2 → 1.18.3
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/README.md +3 -0
- data/lib/guard/jasmine/coverage.rb +0 -2
- data/lib/guard/jasmine/runner.rb +26 -14
- data/lib/guard/jasmine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23bb53cca2e5b5ce98b0b78b80f5bc7562efead1
|
4
|
+
data.tar.gz: 0a7e7b695bc1e37873951d24e851512598eab59a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7f629189012aba7a3668d774b51b499e356d87714bca03abe83dc3604875eb4e8d4c03c1c760b80d5395e6412c49777b53647432b232a409006c6d2fede7a81
|
7
|
+
data.tar.gz: a6799461e50bf9cf5971256f38d91585da535af35df17233c93e6f0a83235e5c27df67bfdaf3585d8f8fc347cff572cd88c6afeb60e2b0ef42c7f54878daa598
|
data/README.md
CHANGED
@@ -577,6 +577,9 @@ can also enable two more reports:
|
|
577
577
|
coverage_html: true # Enable Istanbul HTML coverage report
|
578
578
|
# default: false
|
579
579
|
|
580
|
+
coverage_html_dir: './coverage' # Directory to write Istanbul HTML coverage report to
|
581
|
+
# default: './coverage'
|
582
|
+
|
580
583
|
coverage_summary: true # Enable Istanbul summary coverage report
|
581
584
|
# default: false
|
582
585
|
```
|
@@ -14,8 +14,6 @@ class JasmineCoverage < Tilt::Template
|
|
14
14
|
end
|
15
15
|
|
16
16
|
# Returns a coverage instrumented JavaScript file
|
17
|
-
# when the environment variable `JSCOVERAGE` is `true`
|
18
|
-
# and the `jscoverage` binary is in the `$PATH`.
|
19
17
|
#
|
20
18
|
def evaluate(context, locals)
|
21
19
|
return data unless JasmineCoverage.coverage_bin
|
data/lib/guard/jasmine/runner.rb
CHANGED
@@ -277,20 +277,24 @@ module Guard
|
|
277
277
|
# @option options [Boolean] :hide_success hide success message notification
|
278
278
|
#
|
279
279
|
def notify_coverage_result(coverage, file, options)
|
280
|
-
|
280
|
+
if coverage_bin
|
281
|
+
FileUtils.mkdir_p(coverage_root) unless File.exist?(coverage_root)
|
281
282
|
|
282
|
-
|
283
|
+
update_coverage(coverage, file, options)
|
283
284
|
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
285
|
+
if options[:coverage_summary]
|
286
|
+
generate_summary_report
|
287
|
+
else
|
288
|
+
generate_text_report(file, options)
|
289
|
+
end
|
289
290
|
|
290
|
-
|
291
|
+
check_coverage(options)
|
291
292
|
|
292
|
-
|
293
|
-
|
293
|
+
if options[:coverage_html]
|
294
|
+
generate_html_report(options)
|
295
|
+
end
|
296
|
+
else
|
297
|
+
Formatter.error('Skipping coverage report: unable to locate istanbul in your PATH')
|
294
298
|
end
|
295
299
|
end
|
296
300
|
|
@@ -312,7 +316,7 @@ module Guard
|
|
312
316
|
|
313
317
|
puts ''
|
314
318
|
|
315
|
-
`#{
|
319
|
+
`#{coverage_bin} report --root #{ coverage_root } text #{ coverage_file }`.each_line do |line|
|
316
320
|
puts line.sub(/\n$/, '') if line =~ matcher
|
317
321
|
end
|
318
322
|
|
@@ -326,7 +330,7 @@ module Guard
|
|
326
330
|
#
|
327
331
|
def check_coverage(options)
|
328
332
|
if any_coverage_threshold?(options)
|
329
|
-
coverage = `#{
|
333
|
+
coverage = `#{coverage_bin} check-coverage #{ istanbul_coverage_options(options) } #{ coverage_file } 2>&1`
|
330
334
|
coverage = coverage.split("\n").grep(/ERROR/).join.sub('ERROR:', '')
|
331
335
|
failed = $? && $?.exitstatus != 0
|
332
336
|
|
@@ -347,7 +351,7 @@ module Guard
|
|
347
351
|
#
|
348
352
|
def generate_html_report(options)
|
349
353
|
report_directory = coverage_report_directory(options)
|
350
|
-
`#{
|
354
|
+
`#{coverage_bin} report --dir #{ report_directory } --root #{ coverage_root } html #{ coverage_file }`
|
351
355
|
Formatter.info "Updated HTML report available at: #{ report_directory }/index.html"
|
352
356
|
end
|
353
357
|
|
@@ -359,7 +363,7 @@ module Guard
|
|
359
363
|
|
360
364
|
puts ''
|
361
365
|
|
362
|
-
`#{
|
366
|
+
`#{coverage_bin} report --root #{ coverage_root } text-summary #{ coverage_file }`.each_line do |line|
|
363
367
|
puts line.sub(/\n$/, '') if line =~ /\)$/
|
364
368
|
end
|
365
369
|
|
@@ -640,6 +644,14 @@ module Guard
|
|
640
644
|
end.reject(&:empty?).join(' ')
|
641
645
|
end
|
642
646
|
|
647
|
+
# Returns the coverage executable path.
|
648
|
+
#
|
649
|
+
# @return [String] the path
|
650
|
+
#
|
651
|
+
def coverage_bin
|
652
|
+
@coverage_bin ||= which 'istanbul'
|
653
|
+
end
|
654
|
+
|
643
655
|
# Get the coverage file to save all coverage data.
|
644
656
|
# Creates `tmp/coverage` if not exists.
|
645
657
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-jasmine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.18.
|
4
|
+
version: 1.18.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kessler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|