This document discusses several JavaScript testing frameworks:
- JsUnit is a unit testing framework for JavaScript that runs in browsers, similar to JUnit for Java.
- RhinoUnit is a testing framework for JavaScript that runs in Rhino, similar to other nUnit frameworks. It is small but powerful.
- JSSpec is a behavior driven development (BDD) framework for JavaScript with nested test descriptions and assertions.
- JSpec is an extremely small yet powerful BDD testing framework for JavaScript with an intuitive test browser. It uses a describe/it syntax like Jasmine and supports browser and Rhino running.
3. “ JsUnit is a Unit Testing
framework for client-side
(in-browser) JavaScript.
It is essentially a port of
JUnit to JavaScript
http://www.jsunit.net/
4. “ Javascript Testing Framework using Rhino.
This works similarly to other nUnit testing
frameworks, though somewhat customized
for javascript. It is exceedingly small, but also
surprisingly powerful.
http://code.google.com/p/rhinounit/
5. “ JSSpec is a Javascript BDD
(Behavior Driven Development)
framework.
http://code.google.com/p/jsspec/
6. “ A Javascript BDD Framework
with nested describes, a
convenient assertion syntax,
and an intuitive test browser.
https://github.com/nkallen/screw-unit
7. “ JSpec is a extremely small, yet very
powerful testing framework.
http://visionmedia.github.com/jspec/
18. helloworld $ jspec run --rhino
Passes: 1 Failures: 0 Duration: 37 ms
Matematica
deveria somar dois numeros inteiros.
helloworld $
19. EXAMPLES:
# Run once in default browser
jspec run
# Run once in Safari and Firefox
jspec run --browsers Safari,Firefox
# Run once in Opera, Firefox, Chrome, and WebKit
jspec run --browsers opera,ff,chrome,webkit
# Run custom spec file
jspec run foo.html
# Auto-run browsers when a file is altered
jspec run --bind --browsers Safari,Firefox
# Shortcut for the previous example
jspec --browsers Safari,Firefox
# Run Rhino specs
jspec run --rhino
# Auto-run rhino when a file is altered
jspec --rhino