Posterous
Chris is using Posterous to post everything online. Shouldn't you?
Proicon_thumb
 

Voodoo Tiki God

I am Zero Cool

« Back to blog

JSpec - JavaScript Testing Framework

JSpec is a extremely small, yet very powerful testing framework. Utilizing its own custom grammar and pre-processor, JSpec can operate in ways that no other JavaScript testing framework can. This includes many helpful shorthand literals, a very intuitive / readable syntax, as well as not polluting core object prototypes.

JSpec can also be run suites in a variety of ways, such as via the terminal with Rhino support, via browsers using the DOM or Console formatters, or finally by using the Ruby JavaScript server which runs browsers in the background, reporting back to the terminal.

Features

  • Allows parens to be optional when using matchers to increase readability
  • Assertion graphs displaying how many, and which assertions passed or failed
  • Async support
  • Envjs support
  • Mock Ajax
  • Fixture support
  • Modular extensibility via Modules and hooks.
  • Cascading before/after/before_each/after_each hooks
  • Default / customizable evaluation contexts
  • Does not pollute core object prototypes or global scope
  • DOM sandbox support
  • Extremely simple and intuitive matcher declaration
  • Framework / DOM independent
  • Grammar-less option (for those who dislike JSpec's syntax)
  • Great looking default DOM theme
  • Highly readable custom grammar
  • Nested describes
  • Optionally display failures only, speeding up development
  • Over 45 core matchers
  • Profiling
  • Proxy assertion or 'spy' support
  • Method Stubbing
  • Rhino support
  • Ruby JavaScript testing server
  • Several helpful formatters (dom, console, terminal, ...)
  • Shared behaviors
  • Ruby on Rails Integration
  • Tiny (15 kb compressed, 1600-ish LOC)
  • `jspec` command-line utility for auto-running specs, and initializing project templates

Cheat Sheet

Using the bash cheat sheet library you can get quick terminal access to JSpec's cheat sheet and hundreds more.

cd /tmp && git clone git://github.com/visionmedia/ch.git && cd ch && sudo make install
ch jspec

More Information

Authors

TJ Holowaychuk (tj@vision-media.ca)

this mini site brought to you by : visionmedia/mini

Finally a BDD library I actually like.

Loading mentions Retweet
 
To leave a comment on this posterous, please login by clicking one of the following.
Posterous-login     twitter