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
Unit testing is an essential part of software engineering. Tests provide living documentation of expected behaviors, prevent regressions, and facilitate refactoring. Web applications benefit from testing as much as any other kind of software. In recent years there’s been a proliferation of JavaScript frameworks and testing tools. Piecing together a combination of tools that works well can be daunt
このpromiseオブジェクトは、resolveするので、.then の第一引数で指定したonFulfilled コールバックに true という値を渡すようになってます。 今までのテストの書き方 このgetSuccessPromiseを 1.18.0より以前は以下のように書くことでテストをしていました。 it("should manually handling test...", function (done) { getSuccessPromise().then(function (value) { assert(value); done(); }).catch(done); // <= このcatchが今回の変更での焦点 }); getSuccessPromise()の返り値であるpromiseオブジェクトがresolveされると value に true が入って assert(t
This post has been published more than 10 years ago, it may be obsolete by now. So finally you’re testing your frontend JavaScript code? Great! The more you write tests, the more confident you are with your code… but how much precisely? That’s where code coverage might help. The idea behind code coverage is to record which parts of your code (functions, statements, conditionals and so on) have bee
Travis-CIでブラウザのテストできないのかなー、できないよなーと思いつつ、いろいろ探してみたら出来るような事を知り、今ホット(なのかな?)なtestemを使う事でmochaでのテストも実行できるらしい!という事を知ったので試してみました。 準備 package.jsonの記述を変更します。 package.json "scripts": { "pretest": "./node_modules/.bin/bower install", "test": "./node_modules/.bin/mocha && ./node_modules/.bin/testem ci" }, "devDependencies": { "bower": "~0.8", "chai": "~1.5", "mocha": "~1.8", "testem": "~0.2" } testemが必要なのでtes
{ "testling": { "browsers": { "ie": [ 6, 7, 8, 9, 10 ], "ff": [ 12, 13, 14, 15, 16, 17 ], "chrome": [ 20, 21, 22, 23 ], "opera": [ 10, 11, 12 ], "safari": [ 5.1 ] }, "harness" : "mocha", "files": "test/*.coffee" }, "devDependencies": { "chai": "*", "mocha": "*", "coffee-script": "*" } } githubのプロジェクトページでwebhookを設定 プロジェクトページ > settingボタンをクリック > サイドバーからservice hooks > WebHook URLに http://git.testlin
東京Node学園祭2012 アドベントカレンダーの9日目です。Node.jsとほとんど関係ないうえに内容がけっこう薄い感じなった気がするんですけど気にせずいこうと思います。 フロントエンドのJavaScriptをテストするとき最近はいつもmochaを使ってるんですが、やはりJenkinsとかtravis-ciを使って自動テストもしたいと思って試してみました。 hokaccha/mocha-phantom-travis-test ここではよくあるjQueryで画像のロールオーバーをするというプラグインを作ってそのライブラリに対してテストを書いています。ソースコードはこんな感じです。 $.fn.rollover = function() { return this.each(function() { var $img = $(this); var src = $img.attr('src');
mocha-phantomjs PhantomJS Runners for Mocha Download ZIP Download TAR View On GitHub This project is maintained by metaskills PhantomJS Runners for Mocha Mocha is a feature-rich JavaScript test framework running on node and the browser. Along with the Chai assertion library they make an impressive combo. PhantomJS is a headless WebKit with a JavaScript/CoffeeScript API. It has fast and native supp
Today Paul Campbell asked on Twitter about the possibility of having an automated testing scenario using WebStorm and Mocha. Although there’s nothing built in to WebStorm to support this, it’s actually very simple to setup. All we need are a few bits and pieces: - Mocha. A testing framework for node.js. I’ve been using it for some time and it’s quite decent. It’s from the same guys that have broug
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く