Skip to content

Commit 02eaf72

Browse files
jkwluiAce Nassri
authored and
Ace Nassri
committed
refactor: wrap execSync with encoding: utf-8 (#73)
1 parent 2223f1a commit 02eaf72

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scheduler/system-test/test.samples.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {execSync} = require('child_process');
18+
const cp = require('child_process');
1919
const supertest = require('supertest');
2020
const app = require('../app.js');
2121
const request = supertest(app);
2222

23+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
24+
2325
const PROJECT_ID = process.env.GCLOUD_PROJECT;
2426
const LOCATION_ID = process.env.LOCATION_ID || 'us-central1';
2527
const SERVICE_ID = 'my-service';
@@ -32,10 +34,7 @@ describe('Cloud Scheduler Sample Tests', () => {
3234
`node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}`
3335
);
3436
assert.match(stdout, /Created job/);
35-
jobName = stdout
36-
.toString()
37-
.split('/')
38-
.pop();
37+
jobName = stdout.split('/').pop();
3938
});
4039

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

0 commit comments

Comments
 (0)