Class: Guard::JestRunner::Runner
- Inherits:
-
Object
- Object
- Guard::JestRunner::Runner
- Defined in:
- lib/guard/jest_runner/runner.rb
Overview
This class runs ‘jest` command, retrieves result and notifies. An instance of this class is intended to invoke `jest` only once in its lifetime.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #failed_paths ⇒ Object
-
#initialize(options) ⇒ Runner
constructor
A new instance of Runner.
- #run(paths) ⇒ Object
Constructor Details
#initialize(options) ⇒ Runner
Returns a new instance of Runner.
11 12 13 |
# File 'lib/guard/jest_runner/runner.rb', line 11 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
15 16 17 |
# File 'lib/guard/jest_runner/runner.rb', line 15 def @options end |
Instance Method Details
#failed_paths ⇒ Object
31 32 33 |
# File 'lib/guard/jest_runner/runner.rb', line 31 def failed_paths result[:testResults].select { |f| f[:status] == "failed" }.map { |f| f[:name] }.uniq end |
#run(paths) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/guard/jest_runner/runner.rb', line 17 def run(paths) paths = [:default_paths] unless paths passed = run_for_check(paths) case [:notification] when :failed notify(passed) unless passed when true notify(passed) end passed end |