Giter VIP home page Giter VIP logo

guard-phantomjs-jasmine's Introduction

guard-phantomjs-jasmine

<img src=“https://secure.travis-ci.org/stas/guard-phantomjs-jasmine.png” alt=“Build Status” />

PhantomJS Jasmine Guard automatically runs Jasmine specs with PhantomJS. It executes the tests and displays the test result. No webserver is required!

Install

Please be sure to have Guard installed before continue.

Add guard definition to your Guardfile by running this command:

guard init phantomjs-jasmine

You will need the Jasmine html runner next. If you have it already, just update your Guardfile pointing :runner to the relevant html file.

Usage

Please read Guard usage doc

CI usecase

You can use builtin rake task if you want to run your specs with Rake

Create a Rakefile with the following

require 'guard/phantomjs-jasmine/task'
Guard::PhantomJsJasmineTask.new

if you want to customize the task, you can use options

require 'guard/phantomjs-jasmine/task'
Guard::PhantomJsJasmineTask.new(:ci) do |task|
  task.options[:runner] = 'path/to/jasmine.html'
  task.options[:runner_script] = 'path/to/runner.coffee'
end

Options

The location of the test runner:

guard 'phantomjs-jasmine', :runner => '...' do
  ...
end

AMD / Require.js support

To make sure the Jasmine is initialized correctly before any test gets executed, we need to detect when Jasmine is loaded.

Add this callback:

if ( window['beforeJasmineExecution'] ) {
  beforeJasmineExecution();
}

right before:

jasmineEnv.execute();

Development

Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.

Authors

Stas Suscov

Thanks to Klaus Hartl for guard-phantomjs project.

guard-phantomjs-jasmine's People

Stargazers

 avatar

Watchers

 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.