feat: Deprecation DEPPS5: Config option allowClientClassCreation defaults to false (#8849)
BREAKING CHANGE: The Parse Server option `allowClientClassCreation` defaults to `false`.
This commit is contained in:
@@ -4402,3 +4402,31 @@ describe('login as other user', () => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe('allowClientClassCreation option', () => {
|
||||
it('should enforce boolean values', async () => {
|
||||
const options = [[], 'a', '', 0, 1, {}, 'true', 'false'];
|
||||
for (const option of options) {
|
||||
await expectAsync(reconfigureServer({ allowClientClassCreation: option })).toBeRejected();
|
||||
}
|
||||
});
|
||||
|
||||
it('should accept true value', async () => {
|
||||
await reconfigureServer({ allowClientClassCreation: true });
|
||||
expect(Config.get(Parse.applicationId).allowClientClassCreation).toBe(true);
|
||||
});
|
||||
|
||||
it('should accept false value', async () => {
|
||||
await reconfigureServer({ allowClientClassCreation: false });
|
||||
expect(Config.get(Parse.applicationId).allowClientClassCreation).toBe(false);
|
||||
});
|
||||
|
||||
it('should default false', async () => {
|
||||
// remove predefined allowClientClassCreation:true on global defaultConfiguration
|
||||
delete defaultConfiguration.allowClientClassCreation;
|
||||
await reconfigureServer(defaultConfiguration);
|
||||
expect(Config.get(Parse.applicationId).allowClientClassCreation).toBe(false);
|
||||
// Need to set it back to true to avoid other test fails
|
||||
defaultConfiguration.allowClientClassCreation = true;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user