Doctest.js 是 JavaScript 的测试框架。
示例测试代码:
function capitalize(words) { return words.replace(/\b[a-z]/g, function (m) { return m[0].toUpperCase(); }); } print(capitalize('some words')); // => Some Words print(capitalize('some 4ward words')); // => Some 4ward Words