doctestjs

Ian Bicking has written a doctest for Javascript. This is exactly what I was looking for, so I’ve plugged it in and it’s working great so far — except that the docs have to be coded by hand. I guess the next stop is to port jsdoc-toolkit from Javascript/Rhino to Python, so I can auto-generate the docs.

There was small fix I had to make in order for doctestjs to read the tests appropriately because I’m sometimes sloppy in whether my files use Unix/Mac/Dos line termination. I replaced text.split(/\n/) with text.split(/(\r\n|\r|\n)/). (don’t you love reading regex? Wonder how long it’ll be before somebody ports pyparsing to JS…)

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s