@@ -1547,38 +1547,36 @@ describe('Cloud Code', () => {
1547
1547
} ) ;
1548
1548
1549
1549
describe ( 'cloud jobs' , ( ) => {
1550
- for ( let x = 0 ; x < 1000 ; x ++ ) {
1551
- fit ( 'should define a job' , done => {
1552
- expect ( ( ) => {
1553
- Parse . Cloud . job ( 'myJob' , ( { message } ) => {
1554
- message ( 'Hello, world!!!' ) ;
1555
- } ) ;
1556
- } ) . not . toThrow ( ) ;
1550
+ it ( 'should define a job' , done => {
1551
+ expect ( ( ) => {
1552
+ Parse . Cloud . job ( 'myJob' , ( { message } ) => {
1553
+ message ( 'Hello, world!!!' ) ;
1554
+ } ) ;
1555
+ } ) . not . toThrow ( ) ;
1557
1556
1558
- request ( {
1559
- method : 'POST' ,
1560
- url : 'http://localhost:8378/1/jobs/myJob' ,
1561
- headers : {
1562
- 'X-Parse-Application-Id' : Parse . applicationId ,
1563
- 'X-Parse-Master-Key' : Parse . masterKey ,
1564
- } ,
1557
+ request ( {
1558
+ method : 'POST' ,
1559
+ url : 'http://localhost:8378/1/jobs/myJob' ,
1560
+ headers : {
1561
+ 'X-Parse-Application-Id' : Parse . applicationId ,
1562
+ 'X-Parse-Master-Key' : Parse . masterKey ,
1563
+ } ,
1564
+ } )
1565
+ . then ( async response => {
1566
+ const jobStatusId = response . headers [ 'x-parse-job-status-id' ] ;
1567
+ const checkJobStatus = async ( ) => {
1568
+ const jobStatus = await new Parse . Query ( '_JobStatus' ) . get ( jobStatusId , {
1569
+ useMasterKey : true ,
1570
+ } ) ;
1571
+ return jobStatus . get ( 'finishedAt' ) && jobStatus . get ( 'message' ) === 'Hello, world!!!' ;
1572
+ } ;
1573
+ while ( ! ( await checkJobStatus ( ) ) ) {
1574
+ await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
1575
+ }
1565
1576
} )
1566
- . then ( async response => {
1567
- const jobStatusId = response . headers [ 'x-parse-job-status-id' ] ;
1568
- const checkJobStatus = async ( ) => {
1569
- const jobStatus = await new Parse . Query ( '_JobStatus' ) . get ( jobStatusId , {
1570
- useMasterKey : true ,
1571
- } ) ;
1572
- return jobStatus . get ( 'finishedAt' ) && jobStatus . get ( 'message' ) === 'Hello, world!!!' ;
1573
- } ;
1574
- while ( ! ( await checkJobStatus ( ) ) ) {
1575
- await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
1576
- }
1577
- } )
1578
- . then ( done )
1579
- . catch ( done . fail ) ;
1580
- } ) ;
1581
- }
1577
+ . then ( done )
1578
+ . catch ( done . fail ) ;
1579
+ } ) ;
1582
1580
1583
1581
it ( 'should not run without master key' , done => {
1584
1582
expect ( ( ) => {
0 commit comments