power-doctest という doctest風 にコードと評価結果のコメントを並べるとテストとして実行出来るようなNode製のツールを作りました。
power-doctest power-doctest doctest風のJavaScriptテストツール 評価したい式; // => 期待する評価結果 目的 書籍の写経補助 (not for production) エディタから離れずにコードを評価出来る twada/power-assert 利用なので、間違いが見やすい サンプルコード と テストコードが一緒にあっても違和感がない構文 仕組み Transform JavaScript AST 評価したい式; // => 期待する評価結果 -> assert(評価したい式 === 期待する評価結果); 仕組み(実行) nodeのvmモジュール like eval, but not eval ファイルから読み込んだのと同じように実行できる 実行コンテキストをすり替えられる グローバル空間にあるものをモックに変えたりできる 逆に実行コンテキス
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く