以下のテストを (コメントアウトして) 個別に実行すると、各テストに合格します。ただし、すべてのテストを実行すると、XmlHttpRequest のキャッチされない例外が発生します。suave テスト サーバーはリクエストを受信し、ログにはエラーや問題は示されません。
var HOME_URL = "http://localhost:3000/request";
it("should echo the test request with response", function (done) {
var test = { act: 'test1', qry: {} };
var promise = webix.ajax().post(HOME_URL, JSON.stringify(test));
console.log('test1');
promise.then(function (resp) {
expect(resp.json().succ).to.be(true);
done();
}).fail(function (err) {
done();
throw(err);
});
});
it("should echo the test request with response 2", function (done) {
var test = { act: 'test2', qry: {} };
var promise = webix.ajax().post(HOME_URL, JSON.stringify(test));
console.log('test2');
promise.then(function (resp) {
expect(resp.json().succ).to.be(true);
done();
}).fail(function (err) {
console.log('echo test error', app.util.inspect(promise));
done();
throw(err);
});
});
問題が何であるか、またはこれらのテストをデバッグする方法はありますか?
自分でコードを実行するには (git ノードと npm をインストールする必要があります):
git clone http://github.com/halcwb/GenUnitApp.git
cd GenUnitApp
git checkout failingServer
scripts/run.sh
2 番目のターミナルを開く
./build.sh clienttests
反対票を投じたら、説明してください。質問を改善できます。