feat: Remove deprecation DEPPS4: Remove convenience method for http request Parse.Cloud.httpRequest (#8287)

BREAKING CHANGE: The convenience method for HTTP requests `Parse.Cloud.httpRequest` is removed; use your preferred 3rd party library for making HTTP requests
This commit is contained in:
dblythy
2022-11-11 04:28:49 +11:00
committed by GitHub
parent 739a3a9957
commit 2d79c0835b
8 changed files with 178 additions and 252 deletions

View File

@@ -1686,25 +1686,6 @@ describe('Cloud Code', () => {
obj.save().then(done, done.fail);
});
it('can deprecate Parse.Cloud.httpRequest', async () => {
const logger = require('../lib/logger').logger;
spyOn(logger, 'warn').and.callFake(() => {});
Parse.Cloud.define('hello', () => {
return 'Hello world!';
});
await Parse.Cloud.httpRequest({
method: 'POST',
url: 'http://localhost:8378/1/functions/hello',
headers: {
'X-Parse-Application-Id': Parse.applicationId,
'X-Parse-REST-API-Key': 'rest',
},
});
expect(logger.warn).toHaveBeenCalledWith(
'DeprecationWarning: Parse.Cloud.httpRequest is deprecated and will be removed in a future version. Use a http request library instead.'
);
});
describe('cloud jobs', () => {
it('should define a job', done => {
expect(() => {