== 1.4.0 / 2012-07-09 * Argument matchers (Maximillian Antoni) sinon.match.{any, same, typeOf, instanceOf, has, hasOwn, defined, truthy, falsy} as well as typeOf shortcuts for boolean, number, string, object, function, array, regexp and date. The result of a call can be used with spy.calledWith. * spy.returned now works with matchers and compares objects deeply. * Matcher assertions: calledWithMat
モジュールのロードまわり lib/sinon.js がモジュールのエンドポイント sinon object の作成、環境に応じた初期化、ユーティリティメソッドの定義を行う spy や mock などの機能毎にファイルが分かれる lib/sinon/*.js に配置 lib/sinon/spy.js など sinon.js 大きくは以下のように sinon object を作って返す。 var sinon = (function() { function somePrivateFunction() {}; var sinon = { foo: function foo() {} }; return sinon; }()); node の場合、ブラウザの場合、busterjs の場合で異なった初期化を行う。 node の環境かどうかの判定は module.exports の有無で行う。 var
In my previous post on testing I covered the basics of testing with Mocha, Chai, and Sinon -- including asynchronous testing and stubbing methods with asynchronous callbacks (such as methods which make a server request). That's all well and good, but sometimes it's more convenient or natural to synchronously manipulate the JavaScript timer or create fake servers to instantly and synchronously resp
jQuery#triggerのテスト describe('jQuery#trigger', function() { it('イベントハンドラに値を渡せること', function(done) { var $el = $('<div>'); $el.bind('foo', function(event, val) { expect(val).to.be('bar'); done(); }); $el.trigger('foo', 'bar'); }); }); コールバックが2回呼ばれるかをテスト describe('jQuery#trigger', function() { it('イベントハンドラに値を渡せること', function(done) { var $el = $('<div>'); var count = 0; $el.bind('foo', function(event,
SinonJSDoc 1.0 Welcome to Sinon.JS Documentation.¶ Contents:¶ 各Sinon.JSファイル¶ sinon.js sinon/spy.js sinon/stub.js sinon/mock.js sinon/collection.js sinon/assert.js sinon/sandbox.js sinon/test.js sinon/test_case.js sinon/match.js sinon/util/event.js sinon/util/fake_server.js sinon/util/fake_server_with_clock.js sinon/util/fake_timers.js sinon/util/fake_xml_http_request.js sinon/util/timers_ie.js sin
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く