Skip to content

Generator and rake task for testing of JavaScript by QUnit

Notifications You must be signed in to change notification settings

astashov/qunit_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

== Description

Generator of javascript files with javascript test files and javascript test
runner in different browsers.

This project was heavily inspired from Dr.Nic's jsunittest project (almost forked),
but uses QUnit javascript testing framework (works with jQuery) and not so 
features-riched as jsunittest.


== Installation

  git clone git://github.com/astashov/qunit_test.git vendor/plugins/qunit_test

or as submodule

  git submodule add git://github.com/astashov/qunit_test.git vendor/plugins/qunit_test


== Using

For creating new javascript file with javascript test file, please execute:

  script/generate javascript_test name_of_lib

It will move qunit core files (if they are not there): 
 * testrunner.js to public/javascripts/
 * testsuite.css to public/stylesheets/

Also, it will create your js files: 
 * /public/javascripts/name_of_lib.js 
 * /test/javascripts/name_of_lib_test.html

You should place your test to name_of_lib_test.html file.

For running test in opera, firefox, ie and safari, please execute:

  rake javascript_tests

It will try to run specified browsers, open test files, and send results of
tests to this ruby script.

Output will be similar to this:

  [anton@localhost qunit]$ rake javascript_tests
  (in /home/anton/projects/qunit)

  Skipping Safari, not supported on this OS

  Started tests in Firefox
  .
  Finished in 6 seconds.
  1 tests, 0 failures

  Skipping Internet Explorer, not supported on this OS

  Started tests in Opera
  Qt: Locales not supported on X server
  Qt: Locales not supported on X server
  opera: Activated running instance
  .
  Finished in 1 seconds.
  1 tests, 0 failures

  [anton@localhost qunit]$

== Troubleshooting

Sometimes you should close particular browser with test pages to continue testing 
by next browsers.


== Some links to resources that helped me very much

1. http://docs.jquery.com/QUnit - QUnit testing framework
2. http://jsunittest.com/ - Dr.Nic's testing framework, based on PrototypeJS
    

== Authors and Credits
 
Written by Anton Astashov, with Brenton Cheng, for Astrology.com (a division of iVillage Inc.)
Released under the MIT license.

About

Generator and rake task for testing of JavaScript by QUnit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages