-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Open
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature
Description
Is your feature request related to a problem? Please describe.
When I'm writing tests I would like to be able to skip triggers.
For example, if I do some security check on my triggers I need to match with that on my test, and sometime it's very annoying because the objective is not to test the trigger, but something else. So it will be very useful to skip them.
Describe the solution you'd like
I see 2 major possibilities:
- Add an
optionwhich can be pass (as a context) on actions
object.save( { skip_before_save: true, skip_after_save: true } );
- Use the
contextto simulate the skipping
object.save( { context: { skip_before_save: true, skip_after_save: true } } );
Parse.Cloud.beforeSave("myClass", async (request) => {
if request.context.skip_before_save == false {
// do some work
}
});
Parse.Cloud.afterSave("myClass", async (request) => {
if request.context.skip_after_save == false {
// do some work
}
});
The second solution only required that the context can be used on every triggers - #7058 - but it don't really skip the trigger.
So I definitely think that the first one can be the best option (or something else in the same spirit).
Asing1001
Metadata
Metadata
Assignees
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature