Skip to content

Commit d602ee1

Browse files
committed
Add test case for detectEncoding_ for better coverage.
1 parent 191474d commit d602ee1

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

packages/speech/src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ Speech.prototype.endpointerTypes = {
137137
*/
138138
Speech.detectEncoding_ = function(filename) {
139139
if (!is.string(filename)) {
140-
// istanbul ignore next
141140
return;
142141
}
143142

packages/speech/test/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ describe('Speech', function() {
158158
Speech.detectEncoding_('blah.mp3');
159159
}, /Encoding could not be determined for file: blah\.mp3/);
160160
});
161+
162+
it('should return nothing if the argument is not a string', function() {
163+
assert.equal(Speech.detectEncoding_({}), undefined);
164+
});
161165
});
162166

163167
describe('findFile_', function() {

0 commit comments

Comments
 (0)