File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function scheduleJob(context) {
1010 builder . setPeriodic ( 15 * 60 * 1000 ) ;
1111
1212 // Optional: Set additional requirements under what conditions your job should be triggered
13- builder . setRequiresCharging ( true ) ;
13+ builder . setRequiresCharging ( false ) ;
1414
1515 const jobScheduler = context . getSystemService ( android . content . Context . JOB_SCHEDULER_SERVICE ) ;
1616 console . log ( "Job Scheduled: " + jobScheduler . schedule ( builder . build ( ) ) ) ;
Original file line number Diff line number Diff line change @@ -31,16 +31,15 @@ describe("smoke tests", async function () {
3131 let containsJobExecutions = false ;
3232 let containsJobScheduled = false ;
3333 logs . forEach ( log => {
34- const logPart = JSON . stringify ( log ) ;
35- if ( logPart . includes ( "Job Scheduled: 1" ) ) {
34+ if ( / J o b S c h e d u l e d : 1 / mig. test ( log . message ) ) {
3635 containsJobScheduled = true ;
3736 }
3837
39- if ( logPart . includes ( " Job execution" ) ) {
38+ if ( / J o b E x e c u t i o n / igm . test ( log . message ) ) {
4039 containsJobExecutions = true ;
4140 }
4241 } ) ;
43- assert . isTrue ( containsJobExecutions ) ;
44- assert . isTrue ( containsJobScheduled ) ;
42+ assert . isTrue ( containsJobScheduled , "Not found: Job Scheduled: 1" ) ;
43+ assert . isTrue ( containsJobExecutions , "Not found: Job execution" ) ;
4544 } ) ;
4645} ) ;
You can’t perform that action at this time.
0 commit comments