TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Doctest.js: a humane Javascript test framework

45 pointsby mikexstudiosover 12 years ago

3 comments

j4mieover 12 years ago
This blog post is essential reading for Python developers who see doctest.js and think "ew, doctest": <a href="http://blog.ianbicking.org/2012/10/02/why-doctest-js-is-better-than-pythons-doctest/" rel="nofollow">http://blog.ianbicking.org/2012/10/02/why-doctest-js-is-bett...</a>
skrebbelover 12 years ago
I'm impressed. I really thought I'd seen all approaches to unit testing, but apparently I hadn't. This really appeals to me!<p>Is there anyone here who's been using DocTest and has some experiences to share?<p>I love how, as a side effect, this approach to unit testing encourages implementing a good toString / __str__ on each class. In those languages that have that, of course.
评论 #4608200 未加载
bergieover 12 years ago
If you could combine this with a Literate Programming approach like Literate CoffeeScript[1], then the examples in your API documentation could also become the executable tests.<p>1: <a href="https://github.com/jashkenas/coffee-script/issues/1786" rel="nofollow">https://github.com/jashkenas/coffee-script/issues/1786</a>
评论 #4608119 未加载
评论 #4608109 未加载