feat: add convenience access to Parse Server configuration in Cloud Code via Parse.Server (#8244)

This commit is contained in:
dblythy
2022-10-30 04:03:31 +11:00
committed by GitHub
parent eab9cdd749
commit 9f111158ed
2 changed files with 20 additions and 0 deletions

View File

@@ -50,6 +50,16 @@ describe('Cloud Code', () => {
});
});
it('can get config', () => {
const config = Parse.Server;
let currentConfig = Config.get('test');
expect(Object.keys(config)).toEqual(Object.keys(currentConfig));
config.silent = false;
Parse.Server = config;
currentConfig = Config.get('test');
expect(currentConfig.silent).toBeFalse();
});
it('show warning on duplicate cloud functions', done => {
const logger = require('../lib/logger').logger;
spyOn(logger, 'warn').and.callFake(() => {});