4

What do you use to test CofeeScript in the browser and in the server (node.js)?

Thanks

2 Answers 2

4

I use QUnit to test my CoffeeScript code in both a browser and via commandline; you can use node-qunit to test on the server. There are other solutions out there, but QUnit fits my needs pretty well and can be quite elegantly utilized from CoffeeScript:

module 'MyModule'

test 'MyModule.someFunction', ->
    ok someValue
    strictEqual anotherValue, 323

QUnit, additionally, has support for asynchronous tests, which makes it suitable not only for testing AJAX in the browser but also for testing various asynchronous fixtures in node.js like I/O.

Sign up to request clarification or add additional context in comments.

1 Comment

+1. QUnit is almost certainly the most popular JS testing framework out there, thanks to its association with jQuery (which it does not depend on). It's simple, robust, and feature-rich enough for nearly every project.
2

I use jasmine in both the browser and in node.js (via jasmine-node). I also like the jasmine-jquery plugin. Jasmine has some async support built it as well. The jasmine syntax is very nice in CoffeeScript whereas its a little verbose in javascript with so many nested functions.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.