問題タブ [when-js]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - when.js 未処理の拒否をトラップする
when.js 未処理の拒否をトラップして、ログに記録できるようにしたいと思います。これを達成するために、console.warn() をオーバーライドしましたが、これにより、興味のない when.js 以外のものをログに記録できます。
参照: https://github.com/cujojs/when/blob/master/docs/api.md#debugging-promises
when.jsでprettymonitorを使用しています https://github.com/AriaMinaei/pretty-monitor
node.js - Node.js で未処理の拒否を処理する
フォローアップの質問 re。when.js 未処理の拒否をトラップする
Node.js の process.on() の例では、通常のコンソール/プリティモニターの出力が表示されません。これを保持する方法はありますか。また、ドキュメントのショー: process.on('unhandledRejection', function(reason, key) not ..(promise,reason). ref: http://github.com/cujojs/when/blob/master/docs/debug- api.md
javascript - Jquery Deferred/Promise から When-JS Promise に移行する方法はありますか
jquery ajax 呼び出しによって返される約束から When-JS 機能を使用したいと思います。変換スキームはありますか?
編集 1
ajax - Jasmine AJAX モックは文字列を配列に変換します
AjaxRequest クラスに関するテスト スイートを作成しようとしていますが、リクエストの本文を調べようとすると、このテスト エラーが発生します。
単体テストの関連部分は次のとおりです。
そしてrun()
、これがajaxリクエストが行われるメソッドです
reqwestを使用して ajax リクエストを発行しています。
['text']
リクエスト'text'
がjson本体で送信されたときに期待している理由を誰かが指摘できますか?
ありがとうございました!