You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
目標はgrunt + phantomjs + jasmineの自動テスト環境 先日の大なごやJS Vol.3で、@_tk84さんが発表なさっていた、PhantomJSで自動テストにインスパイアされて、Gruntでそのあたりをコントロールできるようにしました。 今回のポイントは下記。 .coffeeを保存したら、.jsに自動でコンパイル .jsの更新を検知して、SpecRunner.htmlを自動生成 このとき更新された.jsと、対になるテストコードを含んだSpecRunner.htmlが生成される phantomjsで、SpecRunner.htmlを実行した結果を標準出力 出力をgrowlnotifyに渡してデスクトップ通知 @_tk84さんの元ネタのほうでは、EmacsとRubyな環境でしたが、自分はエディタには依存せず、nodeの実行環境だけで何とかできるように構成しました。 aho
Class jasmine.Matchers Defined in: Matchers.js. Class Summary Constructor Attributes Constructor Name and Description
今年の RubyKaigi 2010で、 Sarah Meiさんによる JasmineというJavaScriptのテスティングフレームワークの紹介発表がありました(発表時はRCでしたが、先日(2010年9月14日)に無事バージョン1.0がリリースされています)。 今回はこの Jasmine を紹介したいと思います。 特徴 Jasmineは以下のような特徴を持ったテスティングフレームワークです。 JavaScript自身でJavaScriptをテスト可能 RSpec風の記述が行える スタンドアローン版とRubyGem版 JavaScript自身でJavaScriptをテスト可能 テスト用に専用の言語・フォーマットを使う必要はありません。 RSpec風の記述が行える 全体の構造は、RSpecのユーザーにはお馴染のdescribe や it という記法で記述します。 Rubyのブロックほど簡潔に
Jasmineの使い方を覚えるために複数のWebSocketコネクションが協調して動作する、というよくありがちなシナリオのテストケースを書いてみた。非同期テストの書き方のページを読んでもよくわからなったので、最初わりと苦戦した。 メモ waitsForは、渡した関数がtrueを返すか指定したタイムアウトまで待つ runsに渡した関数は遅延評価される waitsForの結果を待つ場合はrunsを使う setUpとtearDownが無いので、runsを最初と最後に使う waitsForを含むit以降のdescribe内のitは遅延評価される コード Jasmine以外にライブラリはSenchaとSocket.ioを使っている。 var appServerUrl = 'http://dev.hagino3000.com:8888'; describe("Chat Test", function(
describe("Jasmine", function() { it("makes testing JavaScript awesome!", function() { expect(yourCode).toBeLotsBetter(); }); }); Documentation User Guide Release Notes API Documentation Contributor Guide Download For pure JavaScript projects: VersionSizeDateSHA1
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く