diff --git a/client/modules/view/types.js b/client/modules/view/types.js index f8797694..c1f8a7d9 100644 --- a/client/modules/view/types.js +++ b/client/modules/view/types.js @@ -46,7 +46,7 @@ function isMedia(name) { return isAudio(name) || isVideo(name); } -module.exports.isAudiot = isAudio; +module.exports.isAudio = isAudio; function isAudio(name) { return /\.(mp3|ogg|m4a)$/i.test(name); } diff --git a/client/modules/view/types.spec.js b/client/modules/view/types.spec.js new file mode 100644 index 00000000..f97dc125 --- /dev/null +++ b/client/modules/view/types.spec.js @@ -0,0 +1,19 @@ +'use strict'; + +const test = require('supertape'); +const {isAudio} = require('./types'); + +test('cloudcmd: client: view: isAudio', (t) => { + const result = isAudio('hello.mp3'); + + t.ok(result); + t.end(); +}); + +test('cloudcmd: client: view: isAudio: no', (t) => { + const result = isAudio('hello'); + + t.notOk(result); + t.end(); +}); +