refactor: code style fixes with prettier and lint (#8208)
This commit is contained in:
@@ -1244,11 +1244,11 @@ describe('Installations', () => {
|
|||||||
deviceToken: '11433856eed2f1285fb3aa11136718c1198ed5647875096952c66bf8cb976306',
|
deviceToken: '11433856eed2f1285fb3aa11136718c1198ed5647875096952c66bf8cb976306',
|
||||||
deviceType: 'ios',
|
deviceType: 'ios',
|
||||||
};
|
};
|
||||||
await rest.create(config, auth.nobody(config), '_Installation', input)
|
await rest.create(config, auth.nobody(config), '_Installation', input);
|
||||||
const functions = {
|
const functions = {
|
||||||
beforeSave() {},
|
beforeSave() {},
|
||||||
afterSave() {}
|
afterSave() {},
|
||||||
}
|
};
|
||||||
spyOn(functions, 'beforeSave').and.callThrough();
|
spyOn(functions, 'beforeSave').and.callThrough();
|
||||||
spyOn(functions, 'afterSave').and.callThrough();
|
spyOn(functions, 'afterSave').and.callThrough();
|
||||||
Parse.Cloud.beforeSave(Parse.Installation, functions.beforeSave);
|
Parse.Cloud.beforeSave(Parse.Installation, functions.beforeSave);
|
||||||
@@ -1283,7 +1283,7 @@ describe('Installations', () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
const installation = await new Parse.Query(Parse.Installation).first({useMasterKey: true});
|
const installation = await new Parse.Query(Parse.Installation).first({ useMasterKey: true });
|
||||||
expect(installation.get('badge')).toEqual(3);
|
expect(installation.get('badge')).toEqual(3);
|
||||||
expect(functions.beforeSave).not.toHaveBeenCalled();
|
expect(functions.beforeSave).not.toHaveBeenCalled();
|
||||||
expect(functions.afterSave).not.toHaveBeenCalled();
|
expect(functions.afterSave).not.toHaveBeenCalled();
|
||||||
|
|||||||
@@ -469,8 +469,8 @@ describe('server', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('fails if default limit is wrong type', async () => {
|
it('fails if default limit is wrong type', async () => {
|
||||||
for (const value of ["invalid", {}, [], true]) {
|
for (const value of ['invalid', {}, [], true]) {
|
||||||
await expectAsync(reconfigureServer({ defaultLimit: value})).toBeRejectedWith(
|
await expectAsync(reconfigureServer({ defaultLimit: value })).toBeRejectedWith(
|
||||||
'Default limit must be a number.'
|
'Default limit must be a number.'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
PagesOptions,
|
PagesOptions,
|
||||||
SecurityOptions,
|
SecurityOptions,
|
||||||
SchemaOptions,
|
SchemaOptions,
|
||||||
ParseServerOptions
|
ParseServerOptions,
|
||||||
} from './Options/Definitions';
|
} from './Options/Definitions';
|
||||||
import { isBoolean, isString } from 'lodash';
|
import { isBoolean, isString } from 'lodash';
|
||||||
|
|
||||||
@@ -458,7 +458,7 @@ export class Config {
|
|||||||
|
|
||||||
static validateDefaultLimit(defaultLimit) {
|
static validateDefaultLimit(defaultLimit) {
|
||||||
if (defaultLimit == null) {
|
if (defaultLimit == null) {
|
||||||
defaultLimit = ParseServerOptions.defaultLimit.default
|
defaultLimit = ParseServerOptions.defaultLimit.default;
|
||||||
}
|
}
|
||||||
if (typeof defaultLimit !== 'number') {
|
if (typeof defaultLimit !== 'number') {
|
||||||
throw 'Default limit must be a number.';
|
throw 'Default limit must be a number.';
|
||||||
|
|||||||
Reference in New Issue
Block a user