doctest.js

doctest.js is a test runner for Javascript, inspired by Python's doctest. The tests are embedded in an HTML page, and look like what Javascript might look like if you are using an interactive prompt. An example of a test (note $ is uesd as a prompt, > as a continuation prompt):