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 = {
80
80
CoreManager . setLocalDatastoreController ( controller ) ;
81
81
} ,
82
82
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
+
83
93
/**
84
94
* @member {string} Parse.applicationId
85
95
* @static
Original file line number Diff line number Diff line change @@ -161,6 +161,18 @@ describe('Parse module', () => {
161
161
CoreManager . set ( 'REQUEST_BATCH_SIZE' , 20 ) ;
162
162
} ) ;
163
163
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
+
164
176
it ( '_request' , ( ) => {
165
177
const controller = {
166
178
request : jest . fn ( ) ,
You can’t perform that action at this time.
0 commit comments