Search code examples
javascriptruby-on-railsruby-on-rails-3.1bddtestcase

How to write test cases for JavaScript


I have Rails Application which uses JavaScript Extensively.

I would like to know is there any tool (Similar to Rspec, Cucumber For Rails)using which i can test the JS Code Written in my application.

What is the best practice to ensure that your JS is proper?


Solution

  • There are several JavaScript unit testing tools. Among the ones I have used are:

    Web searches for these will turn up lots of comparisons, tutorials, and other articles about using them. There's an article here on using Jasmine with Rails.

    There's a nice article here comparing several JavaScript testing suites for use with Rails.