ianb/doctestjs — pull request #44 by shamrin (2013-04-11 14:42:06+00:00)
Title: Node runner

I've implemented `doctest` runner (issue #34). It can be used like this:

$ cd ~/doctestjs
$ npm link
$ cd ~/your-project
$ doctest test.js
...
Successes: 10
Failures: 0

The output is the same as in `node-example.js`. But to make it usable in practice I had to fix a few related bugs in the process:

* `require` now works inside evaluated scripts, and also resolves relative imports correctly. This was the most annoying thing to fix. See commits for details.
* changed package version from `0.3` to `0.3.0`, to make npm happy. Even `npm link` didn't work without this change.
* renamed package name from "doctest" to "doctestjs", because doctest is already taken on npm. I haven't run `npm publish` yet. Feel free to change the name if you want (e.g. "doctest.js") and publish it yourself.

Commits are somewhat verbose, because I made several unsuccessful attempts to fix `require` bug. I can collapse commits if neccessary.