File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 14
14
15
15
'use strict' ;
16
16
17
+ const { CloudSchedulerClient} = require ( '@google-cloud/scheduler' ) ;
17
18
const { assert} = require ( 'chai' ) ;
18
- const { describe, it} = require ( 'mocha' ) ;
19
+ const { describe, it, before } = require ( 'mocha' ) ;
19
20
const cp = require ( 'child_process' ) ;
20
21
const supertest = require ( 'supertest' ) ;
21
22
const app = require ( '../app.js' ) ;
22
23
const request = supertest ( app ) ;
23
24
24
25
const execSync = cmd => cp . execSync ( cmd , { encoding : 'utf-8' } ) ;
25
-
26
- const PROJECT_ID = process . env . GCLOUD_PROJECT ;
27
26
const LOCATION_ID = process . env . LOCATION_ID || 'us-central1' ;
28
27
const SERVICE_ID = 'my-service' ;
29
28
30
29
describe ( 'Cloud Scheduler Sample Tests' , ( ) => {
31
30
let jobName ;
31
+ let PROJECT_ID ;
32
+
33
+ before ( async ( ) => {
34
+ const client = new CloudSchedulerClient ( ) ;
35
+ PROJECT_ID = await client . getProjectId ( ) ;
36
+ } ) ;
32
37
33
38
it ( 'should create and delete a scheduler job' , async ( ) => {
34
39
const stdout = execSync (
You can’t perform that action at this time.
0 commit comments