File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ describe('Cloud Code', () => {
50
50
} ) ;
51
51
} ) ;
52
52
53
+ it ( 'can get config' , ( ) => {
54
+ const config = Parse . Server ;
55
+ let currentConfig = Config . get ( 'test' ) ;
56
+ expect ( Object . keys ( config ) ) . toEqual ( Object . keys ( currentConfig ) ) ;
57
+ config . silent = false ;
58
+ Parse . Server = config ;
59
+ currentConfig = Config . get ( 'test' ) ;
60
+ expect ( currentConfig . silent ) . toBeFalse ( ) ;
61
+ } ) ;
62
+
53
63
it ( 'show warning on duplicate cloud functions' , done => {
54
64
const logger = require ( '../lib/logger' ) . logger ;
55
65
spyOn ( logger , 'warn' ) . and . callFake ( ( ) => { } ) ;
Original file line number Diff line number Diff line change @@ -374,6 +374,16 @@ class ParseServer {
374
374
375
375
function addParseCloud ( ) {
376
376
const ParseCloud = require ( './cloud-code/Parse.Cloud' ) ;
377
+ Object . defineProperty ( Parse , 'Server' , {
378
+ get ( ) {
379
+ return Config . get ( Parse . applicationId ) ;
380
+ } ,
381
+ set ( newVal ) {
382
+ newVal . appId = Parse . applicationId ;
383
+ Config . put ( newVal ) ;
384
+ } ,
385
+ configurable : true ,
386
+ } ) ;
377
387
Object . assign ( Parse . Cloud , ParseCloud ) ;
378
388
global . Parse = Parse ;
379
389
}
You can’t perform that action at this time.
0 commit comments