Technologies

Tom Hughes tom at compton.nu
Thu Sep 13 17:18:30 BST 2012


On 13/09/12 04:05, John Firebaugh wrote:

> However, I think it is important that we start to get our JavaScript
> under test, at least at the unit level. I suggest using Konacha
> <https://github.com/jfirebaugh/konacha>, a JS testing harness that I
> created and maintain. It's similar to Jasmine, though better integrated
> with the Rails asset pipeline and built using a newer, and better
> engineered, generation of JS testing libraries, mocha
> <http://visionmedia.github.com/mocha/> and chai <http://chaijs.com/>.
>
> Here's an example of what Konacha tests look like:
>
> https://github.com/jfirebaugh/openstreetmap-website/blob/28f40ba13bcb1c6fc4ae66cf6377def559ed73a2/test/javascripts/params_test.js
>
> Tests run in the browser -- while developing, re-running is as simple as
> refreshing the page. For CI, you can run them with Selenium or any other
> driver supported by Capybara. Check out the Konacha README for more
> details and let me know if you have any questions.

I would certainly like to be able to get our javascript under test - my 
concern is to find a way to do so that is compatible with my workflow.

Reading the Konacha documentation it seems that it exists entirely 
outside the normal rails testing framework, and has to be run separately 
so this would have no affect on "rake test" right?

That's both good, in that it doesn't break anything I do now, and bad in 
that it means I have to do something extra if I want to test the js code 
before I deploy.

What I absolutely don't want is anything that causes browser windows to 
start appearing when I run the tests.

Also, from the Konacha documentation it sounds like it is mostly for 
unit testing of small pieces of javscript rather than testing that pages 
actually work properly and do what we want right?

Tom

-- 
Tom Hughes (tom at compton.nu)
http://compton.nu/



More information about the rails-dev mailing list