Skip to content

Commit 2abc90e

Browse files
authored
Merge 8ddaf33 into 1abb841
2 parents 1abb841 + 8ddaf33 commit 2abc90e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Parse.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ const Parse = {
8080
CoreManager.setLocalDatastoreController(controller);
8181
},
8282

83+
/**
84+
* Returns information regarding the current server's health
85+
*
86+
* @returns {Promise}
87+
* @static
88+
*/
89+
getServerHealth() {
90+
return CoreManager.getRESTController().request('GET', 'health');
91+
},
92+
8393
/**
8494
* @member {string} Parse.applicationId
8595
* @static

src/__tests__/Parse-test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ describe('Parse module', () => {
161161
CoreManager.set('REQUEST_BATCH_SIZE', 20);
162162
});
163163

164+
it('getServerHealth', () => {
165+
const controller = {
166+
request: jest.fn(),
167+
ajax: jest.fn(),
168+
};
169+
CoreManager.setRESTController(controller);
170+
Parse.getServerHealth();
171+
const [method, path] = controller.request.mock.calls[0];
172+
expect(method).toBe('GET');
173+
expect(path).toBe('health');
174+
});
175+
164176
it('_request', () => {
165177
const controller = {
166178
request: jest.fn(),

0 commit comments

Comments
 (0)