@@ -18,9 +18,6 @@ const {CloudSchedulerClient} = require('@google-cloud/scheduler');
1818const { assert} = require ( 'chai' ) ;
1919const { describe, it, before} = require ( 'mocha' ) ;
2020const cp = require ( 'child_process' ) ;
21- const supertest = require ( 'supertest' ) ;
22- const app = require ( '../app.js' ) ;
23- const request = supertest ( app ) ;
2421
2522const execSync = cmd => cp . execSync ( cmd , { encoding : 'utf-8' } ) ;
2623const LOCATION_ID = process . env . LOCATION_ID || 'us-central1' ;
@@ -35,36 +32,12 @@ describe('Cloud Scheduler Sample Tests', () => {
3532 PROJECT_ID = await client . getProjectId ( ) ;
3633 } ) ;
3734
38- it ( 'should create and delete a scheduler job' , async ( ) => {
35+ it ( 'should create a scheduler job' , async ( ) => {
3936 const stdout = execSync (
4037 `node createJob.js ${ PROJECT_ID } ${ LOCATION_ID } ${ SERVICE_ID } `
4138 ) ;
4239 assert . match ( stdout , / C r e a t e d j o b / ) ;
4340 jobName = stdout . split ( '/' ) . pop ( ) ;
4441 } ) ;
45-
46- it ( 'should update a scheduler job' , async ( ) => {
47- const stdout = execSync (
48- `node updateJob.js ${ PROJECT_ID } ${ LOCATION_ID } ${ jobName } `
49- ) ;
50- assert . match ( stdout , / U p d a t e d j o b / ) ;
51- } ) ;
52-
53- it ( 'should delete a scheduler job' , async ( ) => {
54- const stdout = execSync (
55- `node deleteJob.js ${ PROJECT_ID } ${ LOCATION_ID } ${ jobName } `
56- ) ;
57- assert . match ( stdout , / J o b d e l e t e d / ) ;
58- } ) ;
5942} ) ;
6043
61- describe ( 'Server should respond to /log_payload' , ( ) => {
62- it ( 'should log the payload' , done => {
63- const body = Buffer . from ( 'test' ) ;
64- request
65- . post ( '/log_payload' )
66- . type ( 'raw' )
67- . send ( body )
68- . expect ( 200 , / P r i n t e d j o b / , done ) ;
69- } ) ;
70- } ) ;
0 commit comments