Skip to content

Commit

Permalink
Use arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mstniy committed Sep 25, 2024
1 parent 147060d commit 2317a95
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/CloudCode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1166,12 +1166,12 @@ describe('Cloud Code', () => {
it('test save triggers get user roles', async () => {
let beforeSaveFlag = false;
let afterSaveFlag = false;
Parse.Cloud.beforeSave('SaveTriggerUserRoles', async function (req) {
Parse.Cloud.beforeSave('SaveTriggerUserRoles', async req => {
expect(await req.getRoles()).toEqual(['TestRole']);
beforeSaveFlag = true;
});

Parse.Cloud.afterSave('SaveTriggerUserRoles', async function (req) {
Parse.Cloud.afterSave('SaveTriggerUserRoles', async req => {
expect(await req.getRoles()).toEqual(['TestRole']);
afterSaveFlag = true;
});
Expand All @@ -1194,12 +1194,12 @@ describe('Cloud Code', () => {
it('should not have user roles for anonymous calls', async () => {
let beforeSaveFlag = false;
let afterSaveFlag = false;
Parse.Cloud.beforeSave('SaveTriggerUserRoles', async function (req) {
Parse.Cloud.beforeSave('SaveTriggerUserRoles', async req => {
expect(req.getRoles).toBeUndefined();
beforeSaveFlag = true;
});

Parse.Cloud.afterSave('SaveTriggerUserRoles', async function (req) {
Parse.Cloud.afterSave('SaveTriggerUserRoles', async req => {
expect(req.getRoles).toBeUndefined();
afterSaveFlag = true;
});
Expand Down Expand Up @@ -2064,7 +2064,7 @@ describe('cloud functions', () => {

it('should have user roles', async () => {
let flag = false;
Parse.Cloud.define('myFunction', async function (req) {
Parse.Cloud.define('myFunction', async req => {
expect(await req.getRoles()).toEqual(['TestRole']);
flag = true;
});
Expand All @@ -2084,7 +2084,7 @@ describe('cloud functions', () => {

it('should not have user roles for anonymous calls', async () => {
let flag = false;
Parse.Cloud.define('myFunction', async function (req) {
Parse.Cloud.define('myFunction', async req => {
expect(req.getRoles).toBeUndefined();
flag = true;
});
Expand Down

0 comments on commit 2317a95

Please sign in to comment.