File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -258,6 +258,11 @@ describe('Cloud Code', () => {
258258 expect ( newObj ) . toBeUndefined ( ) ;
259259 } ) ;
260260
261+ it ( 'beforeSave rejection with custom error code' , function ( done ) {
262+ Parse . Cloud . beforeSave ( 'BeforeSaveFailWithErrorCode' , function ( ) {
263+ throw new Parse . Error ( 999 , 'Nope' ) ;
264+ } ) ;
265+
261266 const obj = new Parse . Object ( 'BeforeSaveFailWithErrorCode' ) ;
262267 obj . set ( 'foo' , 'bar' ) ;
263268 obj . save ( ) . then (
@@ -1547,9 +1552,9 @@ describe('Cloud Code', () => {
15471552 } ) ;
15481553
15491554 /*
1550- TODO: fix for Postgres
1551- trying to delete a field that doesn't exists doesn't play nice
1552- */
1555+ TODO: fix for Postgres
1556+ trying to delete a field that doesn't exists doesn't play nice
1557+ */
15531558 it_exclude_dbs ( [ 'postgres' ] ) (
15541559 'should fully delete objects when using `unset` and `set` with beforeSave (regression test for #1840)' ,
15551560 done => {
@@ -2055,7 +2060,6 @@ describe('Cloud Code', () => {
20552060 }
20562061 } ) ;
20572062} ) ;
2058-
20592063describe ( 'cloud functions' , ( ) => {
20602064 it ( 'Should have request ip' , done => {
20612065 Parse . Cloud . define ( 'myFunction' , req => {
You can’t perform that action at this time.
0 commit comments