Update parse SDK to 2.0.0 (#4925)

* WIP: Integrate JS SDK v2

- Removes backbone style callbacks
- Use Promise instead of Parse.Promise

* Fixes ParseObject and ParseRelation

* Updates Parse.Query with promises

* Alls tests should pass

* Ensure a fresh user is used for each test

* Use REST implementation to avoid side effects for username/email duplicates

* Uses js sdk v2
This commit is contained in:
Florent Vilmart
2018-08-05 13:58:07 -04:00
committed by GitHub
parent a61ef7ee2f
commit ff25ae254d
30 changed files with 3217 additions and 4783 deletions

View File

@@ -6,7 +6,7 @@ const FilesController = require('../lib/Controllers/FilesController').default;
const mockAdapter = {
createFile: () => {
return Parse.Promise.reject(new Error('it failed'));
return Promise.reject(new Error('it failed'));
},
deleteFile: () => { },
getFileData: () => { },
@@ -46,9 +46,10 @@ describe("FilesController", () => {
.then(() => new Parse.File("yolo.txt", [1, 2, 3], "text/plain").save())
.then(
() => done.fail('should not succeed'),
() => setImmediate(() => Parse.Promise.as('done'))
() => setImmediate(() => Promise.resolve('done'))
)
.then(() => logController.getLogs({ from: Date.now() - 500, size: 1000 }))
.then(() => new Promise(resolve => setTimeout(resolve, 200)))
.then(() => logController.getLogs({ from: Date.now() - 1000, size: 1000 }))
.then((logs) => {
// we get two logs here: 1. the source of the failure to save the file
// and 2 the message that will be sent back to the client.