Git Product home page Git Product logo

arailsdemo_guard-jstd's Introduction

Guard::Jstd

Guard::Jstd provides autotest functionality for your test driven JavaScript development with JsTestDriver. This gem was inspired by the jstdutil gem and modeled after the Guard::RSpec gem.

Installing the gem

From the command line:

$ gem install guard-jstd

Or in your Gemfile:

group :test do
  gem "guard-jstd"
end

Generate the suggested Guardfile with:

guard init jstd

Usage

See the Guard gem README for more information about using Guard.

By default, Guard::Jstd will attempt to start the JsTestDriver server. This is done as a forked process, so when you stop Guard with Ctrl-C, the Jstd server will also stop.

Ctrl-\ or Ctrl-Z will run all of your tests.

Configuration

You can specify some configuration options by passing a block to Jstd.configure. This must appear after the 'guard "jstd"' definition in your Guardfile. An example configuration is given below.

guard "jstd" do
  # mappings here
end

Jstd.configure do |c|
  c.java_path = "~/my/path/JsTestDriver-1.3.2.jar"
  c.browser_paths = "\`which open\`"
  c.jstd_config_path = 'someJsTestDriver.conf'
  c.start_server = false
  c.capture_browser = false    # false is the default
end

Defaults

If you have a "$JSTESTDRIVER_HOME" environment variable set on your system, Jstd will automatically look for your JsTestDriver .jar file there. Otherwise, you have to configure the path with "c.java_path".

On start up, Jstd will attempt to start the JsTestDriver server. You can prevent this with "c.start_server = false". The server_port is determined from your JsTestDriver configuration file. If this file does not exist, then the default port is 4224. If you really want Jstd to start the server in a specified port, then you can do that with "c.server_port = 1234".

If you set "c.capture_browser = true", then Jstd will attempt to capture the browser(s) defined in "c.browser_path" when the server is started. Otherwise, you have to manually capture browsers after the server starts.

The default JsTestDriver configuration file name is 'jsTestDriver.conf'. If you are using something else, then use "c.jstd_config_path".

JsTestDriver

Information about setting up JsTestDriver on your system can be found here or on the JsTestDriver homepage.

Guard::CoffeeScript

If you want to use CoffeeScript in your development, add the guard-coffeescript gem. To avoid conflict with Guard::CoffeeScript, Ctrl-\ is disabled for Guard::Jstd. Use Ctrl-Z instead to run all tests.

arailsdemo_guard-jstd's People

Contributors

arailsdemo avatar

Stargazers

Sean P. Myrick V19.1.7.2 avatar

Watchers

 avatar Sean P. Myrick V19.1.7.2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.