Sha256: 223a48298b5b66a44f18824b39bd9c44d95dacc48d1adb028c9339d361531125

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

require_relative '../extension'
require_relative '../command'
require_relative '../webpack/client_config'

module Hippo
    module Command

        class Jest < Thor::Group
            include Thor::Actions

            attr_reader :config

            class_option :watch, :type => :boolean, default: false,
                         desc: "Whether to keep running and watch for file changes"

            class_option :debug, :type => :boolean, default: false


            def configure
                @config = Hippo::Webpack::ClientConfig.new
                @config.invoke_all
                self
            end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hippo-fw-0.9.5 lib/hippo/command/jest.rb
hippo-fw-0.9.4 lib/hippo/command/jest.rb
hippo-fw-0.9.3 lib/hippo/command/jest.rb
hippo-fw-0.9.2 lib/hippo/command/jest.rb