Skip to content

Commit 2a11d31

Browse files
jkwluiJustinBeckwith
authored andcommitted
refactor: wrap execSync with encoding: utf-8 (#208)
1 parent 944aa05 commit 2a11d31

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

texttospeech/test/audioProfile.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
const fs = require('fs');
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 audioProfile.js';
2325
const text = 'Hello Everybody! This is an Audio Profile Optimized Sound Byte.';

texttospeech/test/listVoices.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
'use strict';
1717

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

2123
const cmd = 'node listVoices.js';
2224

texttospeech/test/quickstart.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
const fs = require('fs');
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 outputFile = 'output.mp3';
2325

texttospeech/test/synthesize.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
const fs = require('fs');
1919
const path = require('path');
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 synthesize.js';
2426
const text = 'Hello there.';

0 commit comments

Comments
 (0)