10+1 Things you should know about JavaScript testing - Nov 20, 2010 at John Resig feat. Shibuya.js, in Firefox Developers Conference 2010
10+1 Things you should know about JavaScript testing - Nov 20, 2010 at John Resig feat. Shibuya.js, in Firefox Developers Conference 2010
JavaScript のテスティングフレームワーク QUnit から TAP 出力するための仕組みを作成し、さらに CommonJS 環境下でも動くようにしてみましたので、 github で公開します。ライセンスは QUnit に合わせて MIT と GPLv2 のデュアルライセンスです。 http://github.com/twada/qunit-tap これは何? 平たく言うと、主に画面非依存の JavaScript コードやサーバサイドで動かす JavaScript コードに対してコマンドラインからユニットテストを行うための仕組みです。 js のユニットテストというとブラウザ上で動かすものが一般的ですが、 DOM に依存しないロジックや抽象的なモジュールのテストはできればコマンドライン上で高速に実行させ、即座にフィードバックを得たいものです。 (更新) ヘッドレスブラウザ Phant
アプリケーションを開発する上で、避けて通れないもの、それがテストです。とくにブラウザごとの非互換性が大きい Web アプリケーションでは、念入りなテストが必要です。でも、テストはあまり創造的な作業ではないし、やったからといってなにか機能が増えるわけでもない。できるだけ手間をかけずに済ませたいところですね。 そんなわけで、本日は JavaScript 用のテストフレームワークである JsUnit を利用したユニットテストの方法をご紹介しようと思います。 Ruby のユニットテストの記事でも書きましたが、ユニットテストによるテスト・ファースト開発は開発効率の面でも良い影響があります。まだ導入していない方は、ぜひこの機会に使ってみてください。 JsUnit について 今回利用する JsUnit は Java 用の JUnit を参考にして作られた JavaScript 用のユニットテストフレーム
最近ミクシイアプリ作ってます。(むだづかい告白帳、マイミクイズ) agoです。 このたびjavascript test framework Sweets.jsを作成したのでご紹介したいと思います。 Documents Download JSのtest frameworkはすでに各種ありますが、以下の点を満たすものがなかったので自作しました。 無名関数のテスト callback関数のテスト エラー発生時の行番号取得 以下の形でテストを記述できます。 /*###=> var func = __CODE__ $_$(func(1) === 1); $_$(func(2) === 4); $_$(func(2) === 5); // -> console.warnに行番号を出力 */ var result = (function (arg) { return arg * arg; })(1); 内
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く