diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index 9e91eb024d..15d653a791 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -377,6 +377,7 @@ declare namespace Parse { previousAttributes(): any; relation(attr: string): Relation; remove(attr: string, item: any): any; + revert(): void; save(attrs?: { [key: string]: any } | null, options?: Object.SaveOptions): Promise; save(key: string, value: any, options?: Object.SaveOptions): Promise; save(attrs: object, options?: Object.SaveOptions): Promise; diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index 5063c1ae53..ceb5693087 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -288,7 +288,13 @@ function test_user_acl_roles() { game.setACL(new Parse.ACL(Parse.User.current())); game.save().then((game: Game) => { }); game.save(null, { useMasterKey: true }); - game.save({ score: '10' }, { useMasterKey: true }); + game.save({ score: '10' }, { useMasterKey: true }).then(function (game) { + // Update game then revert it to the last saved state. + game.set("score", '20'); + game.revert(); + }, function (error) { + // The save failed + }); const groupACL = new Parse.ACL();