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
describe("Asynchronous specs", function() { var value, flag; it("should support async execution of test preparation and exepectations", function() { runs(function() { flag = false; value = 0; setTimeout(function() { flag = true; }, 500); }); waitsFor(function() { value++; return flag; }, "The Value should be incremented", 750); runs(function() { expect(value).toBeGreaterThan(0); }); }); });
日頃からJavascriptで開発をしているのにも関わらずあまりテストを書かないので、ここは本格的にテストを書こうと調べてみました。JavascriptのテストフレームワークといったらJsUnitなのかなーと思っていたが、調べてみると結構いろんな種類のテストフレームワークがあったりして、その中で得に人気なのかどうやらJasmineらしい。 Jasmine ~ JavaScript Test フレームワーク より引用: 今回は, JavaScript のテストを行うためのフレームワークJasmine の紹介です。 JavaScript のテストといえば, JSUnit が有名です。 JSUnit は, JUnit とに似たような, Matcher が利用できたりしてわかりやすいのですが, 開発やメンテナンスがストップしており, またWebプロジェクトに組み込まないと利用できないことが ちょっ
describe("abstract suite", function() { it("abstract spec", function() { //spec }); describe("concrete suite", function() { it("concrete spec1", function() { //spec }); it("concrete spec2", function() { //spec }); }); }); describe "abstract suite", -> it "abstract spec", -> #spec describe "concrete suite", -> it "concrete spec1", -> #spec it "concrete spec2", -> #spec
目標は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
Jasmine Headless WebKit Run your Jasmine specs at sonic boom speed! Jasmine is great. I love it. But running Jasmine when you need to test code that will run in a browser environment can be problematic and slow: The Jasmine gem's server makes getting up and testing very fast, but F5-ing your browser for each test run is distracting. Jasmine CI uses Selenium, which speeds up the process a bit, but
Father, husband, engineering manager, programming language theory fan, and a little bit of a geek. he/him/his EnvJasmine 1.7 Released! Thanks to the support of the EnvJasmine community we have a great new update. This one is especially useful for those of you running EnvJasmine in Maven or Rake and are integrating into a CI server like Jenkins! Check out the latest repo at https://github.com/trevm
Jasmine Javascript BDD Framework http://github.com/pivotal/jasmine http://groups.google.com/group/jasmine-js Specs =================== it('should be a test', function () { var foo = 0; foo++; }); Expectations =================== it('should be a test', function () { var foo = 0; // set up the world foo++; // call your application code expect(foo).toEqual(1); // passes because foo == 1 }); Matchers
Update: If you are using Jasmine 2.0 or above, the information here is out of date! Please go to http://jasmine.github.io/2.0/introduction.html#section-Spies instead. Wanna be a spy fast? Well you are in luck! Just kidding! This is actually a cheatsheet for Jasmine Spies. See, while Jasmine itself is very intuitive to use, every time use spies I have to look up the docs. I would blame it on the po
本稿は、Sencha公式ドキュメントの Unit Testing with Jasmine の翻訳です。 I. 導入 このチュートリアルでは既存のExtアプリケーションを取り上げ、ユニットテストするJasmineアサーションライブラリを紹介します。 読者はJavaScript, Ext JS 4, MVCアーキテクチャ及びHTML, CSSの基本及びリソースの使い方について精通している人が対象です。 なぜテストするのか? アプリケーションをテストするには多くの理由があります。 テストはすべてのユースケースを手動で消し込んでゆくことなくアプリケーションの機能性を検証できます。 さらに、アプリケーションがリファクタリングやアップデートされる時に、 テストはそれらの変更がシステムに当たらしバグを呼び込まないように検証することが出来ます。 II. はじめに このチュートリアルではExtJSにバンド
今年の 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のブロックほど簡潔に
akahigeg/jasmine-titanium – GitHub お得意のヤク毛刈りの延長でまとめたものをついでなので公開してみました。 fork歓迎です。 specs.shを見ると分かりますがけっこう強引な手段で実現しているので、あまりお行儀のいい感じのものではないのですが、ひとまずlibとspecにソースを放り込んでいくだけでJasmineがTitanium上で動くようになっているはずです。 READMEの英語が少々インチキだと思うので、日本人の方はREADME.jaの方をどうぞ。 Markdownとか初めて書きましたよ。というかそういう記法があることを初めて知りましたよ。 これまでのあらすじ 興味ある方は以前の取り組みも参照してみてください。 あれ、これあらすじって言わねえ。 Titaniumでユニットテスト | ひげろぐ Titaniumでユニットテスト Jasmine再び編
Jenkins Advent Calendar jp 2011の3日目です。 Titanium Mobile + Jasmine + Jenkins でiPhoneアプリの自動テスト組んでみた、っちゅう話をします。 本当はプラグインを作りたかったんですが、そこまで行かなかったので(言い訳だよ!)、せめて自動テストをどう組んだかの話をしますね。 Titaniumの自動テストを組みたい 最近Titanium Mobileを使ってiPhoneアプリなど作ってます。 Titanium Mobileについてはもう説明もいらないと思いますが、Javascriptを使ってスマートフォンアプリ(特にiPhoneとandroid)を開発することができるプラットフォームですね。 で、Jenkins野郎な私としては、Titaniumでも自動テストを組みたいんですよね。 Javascriptでテストってどう書くん
公式のドキュメントには何の記述もないが、ユニットテストには好きなJavaScriptのテスティングフレームワークを利用できる。 ただしブラウザに依存しないもので、ログの出力をフックできるものに限る。 要はTitaniumのコンソールにログを出力するためにTitanium.API.infoやTitanium.API.errorなどにテストの出力を渡せればよいわけです。 今回はxUnit系で一番勢いがありそうなQUnitとBDD系でよいと言われているJasmineで試してみた。 QUnitを使う Titanium用のアダプターがGitHubで公開されている。 lukaso/qunit – GitHub 自分のプロジェクトで利用する場合はResources以下に次のファイルを設置すればOK。 * runner.js * qunit/qunit.js * qunit/titanium_adapto
This branch is for Jasmine 2.x. Switch to the 1.x branch. Jasmine Reporters Jasmine Reporters is a collection of javascript jasmine reporter classes that can be used with the JasmineBDD testing framework. Included reporters: AppVeyor - POSTs results to AppVeyor when running inside an AppVeyor environment. JUnitXmlReporter - Report test results to a file in JUnit XML Report format. NUnitXmlReporter
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く