Skip to content

Commit

Permalink
refactor: wrap execSync with encoding: utf-8 (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui authored and JustinBeckwith committed Apr 5, 2019
1 parent 9a1c5e2 commit cabfa83
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scheduler/system-test/test.samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
'use strict';

const {assert} = require('chai');
const {execSync} = require('child_process');
const cp = require('child_process');
const supertest = require('supertest');
const app = require('../app.js');
const request = supertest(app);

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const PROJECT_ID = process.env.GCLOUD_PROJECT;
const LOCATION_ID = process.env.LOCATION_ID || 'us-central1';
const SERVICE_ID = 'my-service';
Expand All @@ -32,10 +34,7 @@ describe('Cloud Scheduler Sample Tests', () => {
`node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}`
);
assert.match(stdout, /Created job/);
jobName = stdout
.toString()
.split('/')
.pop();
jobName = stdout.split('/').pop();
});

it('should delete a scheduler job', async () => {
Expand Down

0 comments on commit cabfa83

Please sign in to comment.