Fix GraphQL max upload size (#5940)

This commit is contained in:
Antonio Davi Macedo Coelho de Castro
2019-08-18 23:23:59 -07:00
committed by Diamond Lewis
parent c4e016e5de
commit f5ac94ddb2
2 changed files with 35 additions and 10 deletions

View File

@@ -111,6 +111,20 @@ describe('ParseGraphQLServer', () => {
});
});
describe('_transformMaxUploadSizeToBytes', () => {
it('should transform to bytes', () => {
expect(parseGraphQLServer._transformMaxUploadSizeToBytes('20mb')).toBe(
20971520
);
expect(parseGraphQLServer._transformMaxUploadSizeToBytes('333Gb')).toBe(
357556027392
);
expect(
parseGraphQLServer._transformMaxUploadSizeToBytes('123456KB')
).toBe(126418944);
});
});
describe('applyGraphQL', () => {
it('should require an Express.js app instance', () => {
expect(() => parseGraphQLServer.applyGraphQL()).toThrow(