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', () => {
258
258
expect ( newObj ) . toBeUndefined ( ) ;
259
259
} ) ;
260
260
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
+
261
266
const obj = new Parse . Object ( 'BeforeSaveFailWithErrorCode' ) ;
262
267
obj . set ( 'foo' , 'bar' ) ;
263
268
obj . save ( ) . then (
@@ -1547,9 +1552,9 @@ describe('Cloud Code', () => {
1547
1552
} ) ;
1548
1553
1549
1554
/*
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
+ */
1553
1558
it_exclude_dbs ( [ 'postgres' ] ) (
1554
1559
'should fully delete objects when using `unset` and `set` with beforeSave (regression test for #1840)' ,
1555
1560
done => {
@@ -2055,7 +2060,6 @@ describe('Cloud Code', () => {
2055
2060
}
2056
2061
} ) ;
2057
2062
} ) ;
2058
-
2059
2063
describe ( 'cloud functions' , ( ) => {
2060
2064
it ( 'Should have request ip' , done => {
2061
2065
Parse . Cloud . define ( 'myFunction' , req => {
You can’t perform that action at this time.
0 commit comments