Skip to content

Commit 3b19b87

Browse files
jkwluiAhrar Monsur
authored andcommitted
refactor: wrap execSync with encoding: utf-8 (#218)
1 parent 731fe57 commit 3b19b87

8 files changed

+22
-8
lines changed

video-intelligence/system-test/analyze-streaming-annotation-to-storage.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515

1616
'use strict';
1717

18-
const {execSync} = require('child_process');
18+
const cp = require('child_process');
1919
const {assert} = require('chai');
20+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2021

2122
const cmd = `node analyze-streaming-annotation-to-storage.js`;
2223
const project = process.env.GLCOUD_PROJECT;

video-intelligence/system-test/analyze-streaming-labels.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515

1616
'use strict';
1717

18-
const {execSync} = require('child_process');
18+
const cp = require('child_process');
1919
const {assert} = require('chai');
2020

21+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
22+
2123
const cmd = `node analyze-streaming-labels.js`;
2224
const file = 'resources/cat.mp4';
2325

video-intelligence/system-test/analyze-streaming-object.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515

1616
'use strict';
1717

18-
const {execSync} = require('child_process');
18+
const cp = require('child_process');
1919
const {assert} = require('chai');
2020

21+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
22+
2123
const cmd = `node analyze-streaming-object.js`;
2224
const file = 'resources/cat.mp4';
2325

video-intelligence/system-test/analyze-streaming-safe-search.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515

1616
'use strict';
1717

18-
const {execSync} = require('child_process');
18+
const cp = require('child_process');
1919
const {assert} = require('chai');
20+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2021

2122
const cmd = `node analyze-streaming-safe-search.js`;
2223
const file = 'resources/cat.mp4';

video-intelligence/system-test/analyze-streaming-shot-change.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515

1616
'use strict';
1717

18-
const {execSync} = require('child_process');
18+
const cp = require('child_process');
1919
const {assert} = require('chai');
2020

21+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
22+
2123
const cmd = `node analyze-streaming-shot-change.js`;
2224
const file = 'resources/cat.mp4';
2325

video-intelligence/system-test/analyze.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
'use strict';
1919

2020
const {assert} = require('chai');
21-
const {execSync} = require('child_process');
21+
const cp = require('child_process');
22+
23+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2224

2325
const cmd = 'node analyze.js';
2426
const url = 'gs://nodejs-docs-samples-video/quickstart.mp4';

video-intelligence/system-test/analyze.v1p2beta1.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
'use strict';
1919

2020
const {assert} = require('chai');
21-
const {execSync} = require('child_process');
21+
const cp = require('child_process');
22+
23+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2224

2325
const cmd = 'node analyze.v1p2beta1.js';
2426
const shortUrl = 'gs://nodejs-docs-samples/video/googlework_short.mp4';

video-intelligence/system-test/quickstart.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
const path = require('path');
1919
const {assert} = require('chai');
20-
const {execSync} = require('child_process');
20+
const cp = require('child_process');
21+
22+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2123

2224
const cmd = 'node quickstart.js';
2325
const cwd = path.join(__dirname, '..');

0 commit comments

Comments
 (0)