Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should return a boom 503 server timeout error for ES connection errors', function () {
expect(handleESError(new esErrors.ConnectionFault()).output.statusCode).to.be(503);
expect(handleESError(new esErrors.ServiceUnavailable()).output.statusCode).to.be(503);
expect(handleESError(new esErrors.NoConnections()).output.statusCode).to.be(503);
expect(handleESError(new esErrors.RequestTimeout()).output.statusCode).to.be(503);
});
it('should return a boom 503 server timeout error for ES connection errors', function () {
expect(handleESError(new esErrors.ConnectionFault()).output.statusCode).to.be(503);
expect(handleESError(new esErrors.ServiceUnavailable()).output.statusCode).to.be(503);
expect(handleESError(new esErrors.NoConnections()).output.statusCode).to.be(503);
expect(handleESError(new esErrors.RequestTimeout()).output.statusCode).to.be(503);
});
it('makes es.ServiceUnavailable a SavedObjectsClient/EsUnavailable error', () => {
const error = new esErrors.ServiceUnavailable();
expect(isEsUnavailableError(error)).to.be(false);
expect(decorateEsError(error)).to.be(error);
expect(isEsUnavailableError(error)).to.be(true);
});
it('should return a boom 503 server timeout error for ES connection errors', function () {
expect(handleESError(new esErrors.ConnectionFault()).output.statusCode).to.be(503);
expect(handleESError(new esErrors.ServiceUnavailable()).output.statusCode).to.be(503);
expect(handleESError(new esErrors.NoConnections()).output.statusCode).to.be(503);
expect(handleESError(new esErrors.RequestTimeout()).output.statusCode).to.be(503);
});