File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ( ) ,
You can’t perform that action at this time.
0 commit comments