Class: Lanes::Command::Jest

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/lanes/command/jest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/lanes/command/jest.rb', line 11

def config
  @config
end

Instance Method Details

#config_fileObject



22
23
24
# File 'lib/lanes/command/jest.rb', line 22

def config_file
    config.directory.join('jest.config.json')
end

#configureObject



16
17
18
19
20
# File 'lib/lanes/command/jest.rb', line 16

def configure
    @config = ClientConfig.new
    @config.invoke_all
    self
end

#startObject



26
27
28
29
30
31
32
# File 'lib/lanes/command/jest.rb', line 26

def start
    say 'Starting Jest', :green
    say Dir.pwd, :yellow
    cmd = "$(npm bin)/jest --config #{config_file}"
    cmd << "  --watch" if options[:watch]
    exec(cmd)
end