@@ -50,6 +50,97 @@ 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
+ expect ( Object . keys ( config ) . sort ( ) ) . toEqual (
58
+ [
59
+ '_mount' ,
60
+ 'allowClientClassCreation' ,
61
+ 'allowCustomObjectId' ,
62
+ 'analyticsController' ,
63
+ 'appId' ,
64
+ 'applicationId' ,
65
+ 'auth' ,
66
+ 'authDataManager' ,
67
+ 'cacheController' ,
68
+ 'cacheMaxSize' ,
69
+ 'cacheTTL' ,
70
+ 'clientKey' ,
71
+ 'collectionPrefix' ,
72
+ 'customPages' ,
73
+ 'database' ,
74
+ 'databaseAdapter' ,
75
+ 'databaseURI' ,
76
+ 'defaultLimit' ,
77
+ 'directAccess' ,
78
+ 'dotNetKey' ,
79
+ 'emailVerifyTokenReuseIfValid' ,
80
+ 'enableAnonymousUsers' ,
81
+ 'enableExpressErrorHandler' ,
82
+ 'enforcePrivateUsers' ,
83
+ 'expireInactiveSessions' ,
84
+ 'fileKey' ,
85
+ 'fileUpload' ,
86
+ 'filesAdapter' ,
87
+ 'filesController' ,
88
+ 'generateEmailVerifyTokenExpiresAt' ,
89
+ 'generateSessionExpiresAt' ,
90
+ 'graphQLPath' ,
91
+ 'hasPushScheduledSupport' ,
92
+ 'hasPushSupport' ,
93
+ 'hooksController' ,
94
+ 'host' ,
95
+ 'idempotencyOptions' ,
96
+ 'javascriptKey' ,
97
+ 'jsonLogs' ,
98
+ 'level' ,
99
+ 'liveQueryController' ,
100
+ 'logLevel' ,
101
+ 'loggerController' ,
102
+ 'logsFolder' ,
103
+ 'masterKey' ,
104
+ 'masterKeyIps' ,
105
+ 'maxUploadSize' ,
106
+ 'mountGraphQL' ,
107
+ 'mountPath' ,
108
+ 'mountPlayground' ,
109
+ 'objectIdSize' ,
110
+ 'pages' ,
111
+ 'parseGraphQLController' ,
112
+ 'playgroundPath' ,
113
+ 'port' ,
114
+ 'preserveFileName' ,
115
+ 'preventLoginWithUnverifiedEmail' ,
116
+ 'protectedFields' ,
117
+ 'push' ,
118
+ 'pushController' ,
119
+ 'pushControllerQueue' ,
120
+ 'pushWorker' ,
121
+ 'readOnlyMasterKey' ,
122
+ 'requestKeywordDenylist' ,
123
+ 'restAPIKey' ,
124
+ 'revokeSessionOnPasswordReset' ,
125
+ 'scheduledPush' ,
126
+ 'schemaCache' ,
127
+ 'security' ,
128
+ 'serverStartComplete' ,
129
+ 'serverURL' ,
130
+ 'sessionLength' ,
131
+ 'silent' ,
132
+ 'userController' ,
133
+ 'verbose' ,
134
+ 'verifyUserEmails' ,
135
+ 'webhookKey' ,
136
+ ] . sort ( )
137
+ ) ;
138
+ config . silent = false ;
139
+ Parse . Server = config ;
140
+ currentConfig = Config . get ( 'test' ) ;
141
+ expect ( currentConfig . silent ) . toBeFalse ( ) ;
142
+ } ) ;
143
+
53
144
it ( 'show warning on duplicate cloud functions' , done => {
54
145
const logger = require ( '../lib/logger' ) . logger ;
55
146
spyOn ( logger , 'warn' ) . and . callFake ( ( ) => { } ) ;
0 commit comments