この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
I've been getting big into promises over the last year. I think the two best resources that I've learnt from today is Forbes Lindesay's talk at JSConf.EU 2013 and Jake Archibald's excellent promise article on html5rocks. There's been some patterns that I use over and over so I wanted to share and document them. Please note that the examples used are mostly based on my real code, but have been simp
JavaScript Promiseの実行順序(Firefox31とChrome37で違うけどどっちが正しい?)JavaScript var p = new Promise(function(fulfill, reject){ console.log("start"); fulfill(""); }); p.then(function(result){ console.log("1-1"); }).then(function(result){ console.log("1-2"); }).then(function(result){ console.log("1-3"); }); p.then(function(result){ console.log("2-1") }).then(function(result){ console.log("2-2"); }).then(function
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く