Remove request and request-promise from dev dependencies (#5077)
* removes from emailverificationtoken spec * updates winston * Updates ValidationAndPasswordsReset * Use local request in schemas * Removes request in rest.spec * Removes request from PushRouter0 * removes request from public API * removes request from index.spec * Removes request form parse.push spec * removes request from ParseInstallation spec * Removes from ParseHooks * removes request from ParseGlobalConfig.spec * Removes request from ParseAPI.spec.js * removes request from LogsRouter * removes in features * Filters undefined headers instead of crashing * Removes request from ParseUser spec * Removes usage of request in ParseFile.spec.js * Removes request from AuthAdapters.js * removes request-promise from ParseGeoPoint.spec * Removes request-promise from ParseQuery spec * remove request-promise from UserPII * removes request-promise from EnableExpressErrorHandler * Updates RevocableSessionUpgrade spec * Update RestQuery * Removes read preferenceOptionM * ensure we forward auth from URL * use request in CloudCode.spec.js * Removes request-promise from JobSchedule.spec * Removes rp from VerifyUserPassword.spec.js * Removes rp from PasswordPolicy spec * Removes rp from ParsePolygon spec * Removes rp from fullTextSearch spec * Removes rp from PArseQuery.Aggregate * Ensure we properly forward errors * Removes request and request-promise
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const request = require('request');
|
||||
const request = require('../lib/request');
|
||||
|
||||
const delayPromise = delay => {
|
||||
return new Promise(resolve => {
|
||||
@@ -153,19 +153,16 @@ describe('Parse.Push', () => {
|
||||
)
|
||||
.then(() => delayPromise(500))
|
||||
.then(() => {
|
||||
request.get(
|
||||
{
|
||||
url: 'http://localhost:8378/1/classes/_PushStatus',
|
||||
json: true,
|
||||
headers: {
|
||||
'X-Parse-Application-Id': 'test',
|
||||
},
|
||||
request({
|
||||
url: 'http://localhost:8378/1/classes/_PushStatus',
|
||||
json: true,
|
||||
headers: {
|
||||
'X-Parse-Application-Id': 'test',
|
||||
},
|
||||
(error, response, body) => {
|
||||
expect(body.error).toEqual('unauthorized');
|
||||
done();
|
||||
}
|
||||
);
|
||||
}).then(fail, response => {
|
||||
expect(response.data.error).toEqual('unauthorized');
|
||||
done();
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
jfail(err);
|
||||
@@ -191,28 +188,26 @@ describe('Parse.Push', () => {
|
||||
)
|
||||
.then(() => delayPromise(500)) // put a delay as we keep writing
|
||||
.then(() => {
|
||||
request.get(
|
||||
{
|
||||
url: 'http://localhost:8378/1/classes/_PushStatus',
|
||||
json: true,
|
||||
headers: {
|
||||
'X-Parse-Application-Id': 'test',
|
||||
'X-Parse-Master-Key': 'test',
|
||||
},
|
||||
request({
|
||||
url: 'http://localhost:8378/1/classes/_PushStatus',
|
||||
json: true,
|
||||
headers: {
|
||||
'X-Parse-Application-Id': 'test',
|
||||
'X-Parse-Master-Key': 'test',
|
||||
},
|
||||
(error, response, body) => {
|
||||
try {
|
||||
expect(body.results.length).toEqual(1);
|
||||
expect(body.results[0].query).toEqual('{"deviceType":"ios"}');
|
||||
expect(body.results[0].payload).toEqual(
|
||||
'{"badge":"increment","alert":"Hello world!"}'
|
||||
);
|
||||
} catch (e) {
|
||||
jfail(e);
|
||||
}
|
||||
done();
|
||||
}).then(response => {
|
||||
const body = response.data;
|
||||
try {
|
||||
expect(body.results.length).toEqual(1);
|
||||
expect(body.results[0].query).toEqual('{"deviceType":"ios"}');
|
||||
expect(body.results[0].payload).toEqual(
|
||||
'{"badge":"increment","alert":"Hello world!"}'
|
||||
);
|
||||
} catch (e) {
|
||||
jfail(e);
|
||||
}
|
||||
);
|
||||
done();
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
jfail(err);
|
||||
|
||||
Reference in New Issue
Block a user