mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[es/test] improve failure logging
This commit is contained in:
parent
d7bcab9f96
commit
7de6323976
1 changed files with 10 additions and 4 deletions
|
@ -38,12 +38,18 @@ describe('plugins/elasticsearch', function () {
|
|||
describe(format('%s %s', options.method, options.url), function () {
|
||||
it('should should return ' + statusCode, function (done) {
|
||||
kbnTestServer.makeRequest(kbnServer, options, function (res) {
|
||||
try {
|
||||
expect(res.statusCode).to.be(statusCode);
|
||||
if (res.statusCode === statusCode) {
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
return;
|
||||
}
|
||||
|
||||
done(new Error(`
|
||||
Invalid response code from elasticseach:
|
||||
${res.statusCode} should be ${statusCode}
|
||||
|
||||
Response:
|
||||
${res.payload}
|
||||
`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue