diff --git a/.eslintrc.json b/.eslintrc.json index 20aa410a..54430054 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,10 +2,12 @@ "extends": "airbnb-base", "env": { "node": true, - "es6": true, "browser": true, "jest/globals": true }, + "parserOptions": { + "ecmaVersion": 2021 + }, "globals": { "io": true }, @@ -34,6 +36,8 @@ "no-shadow": "off", "import/no-extraneous-dependencies": "off", "import/no-dynamic-require": "off", + "prefer-promise-reject-errors": ["off"], + "no-async-promise-executor": ["off"], "no-underscore-dangle": ["error", { "allowAfterThis": true }], "space-before-function-paren": ["error", "always"], "prefer-destructuring": ["error", { "array": true, "object": true }], diff --git a/app/src/js/listener.js b/app/src/js/listener.js index 20d08527..87315ec0 100644 --- a/app/src/js/listener.js +++ b/app/src/js/listener.js @@ -17,7 +17,7 @@ listener.listening = (stream, minDecibels, maxBlankTime, analyser.getByteFrequencyData(data) - if (data.some(v => v)) { + if (data.some((v) => v)) { if (triggered) { triggered = false diff --git a/scripts/check.js b/scripts/check.js index 98374b49..bdbd3ecb 100644 --- a/scripts/check.js +++ b/scripts/check.js @@ -36,38 +36,38 @@ export default () => new Promise(async (resolve, reject) => { can_offline_stt: { title: 'Offline speech-to-text', type: 'warning', v: true } } - log.title('Checking') + log.title('Checking'); // Environment checking - ;(await Promise.all([ + (await Promise.all([ command('node --version', { shell: true }), command('npm --version', { shell: true }), command('pipenv --version', { shell: true }) ])).forEach((p) => { log.info(p.command) - if (p.command.indexOf('node --version') !== -1 && - !semver.satisfies(semver.clean(p.stdout), `>=${nodeMinRequiredVersion}`)) { + if (p.command.indexOf('node --version') !== -1 + && !semver.satisfies(semver.clean(p.stdout), `>=${nodeMinRequiredVersion}`)) { Object.keys(report).forEach((item) => { if (report[item].type === 'error') report[item].v = false }) log.error(`${p.stdout}\nThe Node.js version must be >=${nodeMinRequiredVersion}. Please install it: https://nodejs.org (or use nvm)\n`) - } else if (p.command.indexOf('npm --version') !== -1 && - !semver.satisfies(semver.clean(p.stdout), `>=${npmMinRequiredVersion}`)) { + } else if (p.command.indexOf('npm --version') !== -1 + && !semver.satisfies(semver.clean(p.stdout), `>=${npmMinRequiredVersion}`)) { Object.keys(report).forEach((item) => { if (report[item].type === 'error') report[item].v = false }) log.error(`${p.stdout}\nThe npm version must be >=${npmMinRequiredVersion}. Please install it: https://www.npmjs.com/get-npm (or use nvm)\n`) } else { log.success(`${p.stdout}\n`) } - }) + }); - ;(await Promise.all([ + (await Promise.all([ command('pipenv --where', { shell: true }), command('pipenv run python --version', { shell: true }) ])).forEach((p) => { log.info(p.command) - if (p.command.indexOf('pipenv run python --version') !== -1 && - !semver.satisfies(p.stdout.split(' ')[1], `>=${pythonMinRequiredVersion}`)) { + if (p.command.indexOf('pipenv run python --version') !== -1 + && !semver.satisfies(p.stdout.split(' ')[1], `>=${pythonMinRequiredVersion}`)) { Object.keys(report).forEach((item) => { if (report[item].type === 'error') report[item].v = false }) log.error(`${p.stdout}\nThe Python version must be >=${pythonMinRequiredVersion}. Please install it: https://www.python.org/downloads\n`) } else { diff --git a/scripts/release/generate-changelog.js b/scripts/release/generate-changelog.js index 9ed378d1..810134f4 100644 --- a/scripts/release/generate-changelog.js +++ b/scripts/release/generate-changelog.js @@ -6,7 +6,7 @@ import log from '@/helpers/log' /** * Update version number in files which need version number */ -export default version => new Promise(async (resolve, reject) => { +export default (version) => new Promise(async (resolve, reject) => { const changelog = 'CHANGELOG.md' const tmpChangelog = 'TMP-CHANGELOG.md' diff --git a/scripts/release/update-version.js b/scripts/release/update-version.js index 66c1c868..b9aa61a1 100644 --- a/scripts/release/update-version.js +++ b/scripts/release/update-version.js @@ -5,7 +5,7 @@ import log from '@/helpers/log' /** * Update version number in files which need version number */ -export default version => new Promise(async (resolve, reject) => { +export default (version) => new Promise(async (resolve, reject) => { log.info('Updating version...') const promises = [] diff --git a/scripts/setup/setup-core.js b/scripts/setup/setup-core.js index 8198a91d..56a62580 100644 --- a/scripts/setup/setup-core.js +++ b/scripts/setup/setup-core.js @@ -20,14 +20,14 @@ export default () => new Promise((resolve) => { const way = path.join(dir, entities[i]) if (fs.statSync(way).isDirectory()) { list(way) - } else if (entities[i].indexOf('.sample.json') !== -1 && - !fs.existsSync(`${dir}/${file}`)) { // Clone config from sample in case there is no existing config file + } else if (entities[i].indexOf('.sample.json') !== -1 + && !fs.existsSync(`${dir}/${file}`)) { // Clone config from sample in case there is no existing config file fs.createReadStream(`${dir}/${entities[i]}`) .pipe(fs.createWriteStream(`${dir}/${file}`)) log.success(`${file} file created`) - } else if (entities[i].indexOf('.sample.json') !== -1 && - fs.existsSync(`${dir}/${file}`)) { + } else if (entities[i].indexOf('.sample.json') !== -1 + && fs.existsSync(`${dir}/${file}`)) { log.success(`${file} already exists`) } } diff --git a/scripts/setup/setup-packages-config.js b/scripts/setup/setup-packages-config.js index 4e3360d5..ad9ab229 100644 --- a/scripts/setup/setup-packages-config.js +++ b/scripts/setup/setup-packages-config.js @@ -14,8 +14,7 @@ export default () => new Promise((resolve, reject) => { const packagesDir = 'packages' // Get packages list const packages = fs.readdirSync(packagesDir) - .filter(entity => - fs.statSync(path.join(packagesDir, entity)).isDirectory()) + .filter((entity) => fs.statSync(path.join(packagesDir, entity)).isDirectory()) // Browse packages for (let i = 0; i < packages.length; i += 1) { diff --git a/scripts/train.js b/scripts/train.js index 7adc49b6..725622d2 100644 --- a/scripts/train.js +++ b/scripts/train.js @@ -37,8 +37,7 @@ export default () => new Promise(async (resolve, reject) => { manager = new NlpManager({ languages: lang }) } const packages = fs.readdirSync(packagesDir) - .filter(entity => - fs.statSync(path.join(packagesDir, entity)).isDirectory()) + .filter((entity) => fs.statSync(path.join(packagesDir, entity)).isDirectory()) let expressionsObj = { } for (let i = 0; i < packages.length; i += 1) { diff --git a/server/src/api/downloads/download.controller.js b/server/src/api/downloads/download.controller.js index ad59c66e..3ab4260f 100644 --- a/server/src/api/downloads/download.controller.js +++ b/server/src/api/downloads/download.controller.js @@ -34,7 +34,9 @@ downloadController.get = (req, res) => { if (err && err.code === 'ENOENT') { message = 'There is no content to download for this module.' log.error(message) - res.json({ success: false, status: 404, code: 'module_dir_not_found', message }) + res.json({ + success: false, status: 404, code: 'module_dir_not_found', message + }) } else { if (err) log.error(err) @@ -95,12 +97,16 @@ downloadController.get = (req, res) => { } else { message = 'This module does not exist.' log.error(message) - res.json({ success: false, status: 404, code: 'module_not_found', message }) + res.json({ + success: false, status: 404, code: 'module_not_found', message + }) } } else { message = 'Bad request.' log.error(message) - res.json({ success: false, status: 400, code: 'bad_request', message }) + res.json({ + success: false, status: 400, code: 'bad_request', message + }) } } diff --git a/server/src/core/brain.js b/server/src/core/brain.js index d7ed7b8d..3ac6a5d4 100644 --- a/server/src/core/brain.js +++ b/server/src/core/brain.js @@ -181,8 +181,8 @@ class Brain { /* istanbul ignore next */ // Synchronize the downloaded content if enabled - if (this.finalOutput.type === 'end' && this.finalOutput.options.synchronization && this.finalOutput.options.synchronization.enabled && - this.finalOutput.options.synchronization.enabled === true) { + if (this.finalOutput.type === 'end' && this.finalOutput.options.synchronization && this.finalOutput.options.synchronization.enabled + && this.finalOutput.options.synchronization.enabled === true) { const sync = new Synchronizer( this, obj.classification, diff --git a/server/src/core/ner.js b/server/src/core/ner.js index d942d730..ec105f5f 100644 --- a/server/src/core/ner.js +++ b/server/src/core/ner.js @@ -17,7 +17,7 @@ class Ner { } static logExtraction (entities) { - entities.forEach(ent => log.success(`{ value: ${ent.sourceText}, entity: ${ent.entity} }`)) + entities.forEach((ent) => log.success(`{ value: ${ent.sourceText}, entity: ${ent.entity} }`)) } /** @@ -50,7 +50,9 @@ class Ner { const entity = actionEntities[i] if (!this.supportedEntityTypes.includes(entity.type)) { - reject({ type: 'warning', obj: new Error(`"${entity.type}" action entity type not supported`), code: 'random_ner_type_not_supported', data: { '%entity_type%': entity.type } }) + reject({ + type: 'warning', obj: new Error(`"${entity.type}" action entity type not supported`), code: 'random_ner_type_not_supported', data: { '%entity_type%': entity.type } + }) } else if (entity.type === 'regex') { promises.push(this.injectRegexEntity(lang, entity)) } else if (entity.type === 'trim') { diff --git a/server/src/core/nlu.js b/server/src/core/nlu.js index 2dad1f56..7c3a01d1 100644 --- a/server/src/core/nlu.js +++ b/server/src/core/nlu.js @@ -72,7 +72,9 @@ class Nlu { const lang = langs[process.env.LEON_LANG].short const result = await this.classifier.process(lang, query) - const { domain, intent, score, entities } = result + const { + domain, intent, score, entities + } = result const [moduleName, actionName] = intent.split('.') let obj = { query, diff --git a/server/src/core/server.js b/server/src/core/server.js index f63e1044..a5d2ac83 100644 --- a/server/src/core/server.js +++ b/server/src/core/server.js @@ -25,7 +25,6 @@ class Server { this.server = { } } - /** * Server entry point */ diff --git a/server/src/core/synchronizer.js b/server/src/core/synchronizer.js index 4a7dc435..54d795d9 100644 --- a/server/src/core/synchronizer.js +++ b/server/src/core/synchronizer.js @@ -92,11 +92,11 @@ class Synchronizer { // Browse entities for (let i = 0; i < list.data.files.length; i += 1) { // In case the module folder exists - if (list.data.files[i].mimeType === folderMimeType && - list.data.files[i].name === driveFolderName) { + if (list.data.files[i].mimeType === folderMimeType + && list.data.files[i].name === driveFolderName) { folderId = list.data.files[i].id return cb(null, true, folderId) - } else if ((i + 1) === list.data.files.length) { + } else if ((i + 1) === list.data.files.length) { // eslint-disable-line no-else-return return cb(null, false, folderId) } // TODO: UI toolbox to reach this scope @@ -106,6 +106,7 @@ class Synchronizer { log.title('Synchronizer'); log.success(`"${list.data.files[i].id}" deleted`) }, 200 * i) */ } + return false }, (folderExists, folderId, cb) => { diff --git a/server/src/helpers/log.js b/server/src/helpers/log.js index 6c894eed..62071584 100644 --- a/server/src/helpers/log.js +++ b/server/src/helpers/log.js @@ -4,9 +4,9 @@ import date from '@/helpers/date' const log = { } -log.success = value => console.log('\x1b[32m✔ %s\x1b[0m', value) +log.success = (value) => console.log('\x1b[32m✔ %s\x1b[0m', value) -log.info = value => console.info('\x1b[36m➡ %s\x1b[0m', value) +log.info = (value) => console.info('\x1b[36m➡ %s\x1b[0m', value) log.error = (value) => { const path = `${__dirname}/../../../logs/errors.log` @@ -29,10 +29,10 @@ log.error = (value) => { return console.error('\x1b[31m✖ %s\x1b[0m', value) } -log.warning = value => console.warn('\x1b[33m❗ %s\x1b[0m', value) +log.warning = (value) => console.warn('\x1b[33m❗ %s\x1b[0m', value) -log.title = value => console.log('\n---\n\n\x1b[7m.: %s :.\x1b[0m\n', value.toUpperCase()) +log.title = (value) => console.log('\n---\n\n\x1b[7m.: %s :.\x1b[0m\n', value.toUpperCase()) -log.default = value => console.log('%s', value) +log.default = (value) => console.log('%s', value) export default log diff --git a/server/src/helpers/string.js b/server/src/helpers/string.js index 61e37fb7..433936c1 100644 --- a/server/src/helpers/string.js +++ b/server/src/helpers/string.js @@ -3,27 +3,27 @@ const string = { } /** * Parse, map (with object) and replace value(s) in a string */ -string.pnr = (s, obj) => s.replace(new RegExp(Object.keys(obj).join('|'), 'gi'), matched => obj[matched]) +string.pnr = (s, obj) => s.replace(new RegExp(Object.keys(obj).join('|'), 'gi'), (matched) => obj[matched]) /** * Uppercase for the first letter */ -string.ucfirst = s => s.charAt(0).toUpperCase() + s.substr(1) +string.ucfirst = (s) => s.charAt(0).toUpperCase() + s.substr(1) /** * Transform snake_case string to PascalCase */ -string.snakeToPascalCase = s => s.split('_').map(chunk => string.ucfirst(chunk)).join('') +string.snakeToPascalCase = (s) => s.split('_').map((chunk) => string.ucfirst(chunk)).join('') /** * Random string */ -string.random = n => Math.random().toString(36).slice(-n) +string.random = (n) => Math.random().toString(36).slice(-n) /** * Remove accents */ -string.removeAccents = s => s.normalize('NFD').replace(/[\u0300-\u036f]/g, '') +string.removeAccents = (s) => s.normalize('NFD').replace(/[\u0300-\u036f]/g, '') /** * Remove end-punctuation diff --git a/server/src/stt/google-cloud-stt/parser.js b/server/src/stt/google-cloud-stt/parser.js index 6d4f9b2b..ae8fdd5b 100644 --- a/server/src/stt/google-cloud-stt/parser.js +++ b/server/src/stt/google-cloud-stt/parser.js @@ -41,7 +41,7 @@ parser.parse = async (buffer, cb) => { audio, config: parser.conf }) - const string = res[0].results.map(data => data.alternatives[0].transcript).join('\n') + const string = res[0].results.map((data) => data.alternatives[0].transcript).join('\n') cb({ string }) } catch (e) { diff --git a/server/src/stt/stt.js b/server/src/stt/stt.js index 0df94193..0df60954 100644 --- a/server/src/stt/stt.js +++ b/server/src/stt/stt.js @@ -33,8 +33,8 @@ class Stt { /* istanbul ignore next */ if (this.provider === 'google-cloud-stt' && typeof process.env.GOOGLE_APPLICATION_CREDENTIALS === 'undefined') { process.env.GOOGLE_APPLICATION_CREDENTIALS = `${__dirname}/../config/voice/google-cloud.json` - } else if (typeof process.env.GOOGLE_APPLICATION_CREDENTIALS !== 'undefined' && - process.env.GOOGLE_APPLICATION_CREDENTIALS.indexOf('config/voice/google-cloud.json') === -1) { + } else if (typeof process.env.GOOGLE_APPLICATION_CREDENTIALS !== 'undefined' + && process.env.GOOGLE_APPLICATION_CREDENTIALS.indexOf('config/voice/google-cloud.json') === -1) { log.warning(`The "GOOGLE_APPLICATION_CREDENTIALS" env variable is already settled with the following value: "${process.env.GOOGLE_APPLICATION_CREDENTIALS}"`) } diff --git a/server/src/stt/watson-stt/parser.js b/server/src/stt/watson-stt/parser.js index 8c71de6a..3d6b6cef 100644 --- a/server/src/stt/watson-stt/parser.js +++ b/server/src/stt/watson-stt/parser.js @@ -44,7 +44,7 @@ parser.parse = async (buffer, cb) => { client.recognize(parser.conf) .then(({ result }) => { - const string = result.results.map(data => data.alternatives[0].transcript).join('\n') + const string = result.results.map((data) => data.alternatives[0].transcript).join('\n') cb({ string }) }) @@ -56,7 +56,7 @@ parser.parse = async (buffer, cb) => { if (err) { log.error(`Watson STT: ${err}`) } else { - const string = res.results.map(data => data.alternatives[0].transcript).join('\n') + const string = res.results.map((data) => data.alternatives[0].transcript).join('\n') cb({ string }) } diff --git a/server/src/tts/tts.js b/server/src/tts/tts.js index da997ac5..9f4b3f48 100644 --- a/server/src/tts/tts.js +++ b/server/src/tts/tts.js @@ -36,8 +36,8 @@ class Tts { /* istanbul ignore next */ if (this.provider === 'google-cloud-tts' && typeof process.env.GOOGLE_APPLICATION_CREDENTIALS === 'undefined') { process.env.GOOGLE_APPLICATION_CREDENTIALS = `${__dirname}/../config/voice/google-cloud.json` - } else if (typeof process.env.GOOGLE_APPLICATION_CREDENTIALS !== 'undefined' && - process.env.GOOGLE_APPLICATION_CREDENTIALS.indexOf('config/voice/google-cloud.json') === -1) { + } else if (typeof process.env.GOOGLE_APPLICATION_CREDENTIALS !== 'undefined' + && process.env.GOOGLE_APPLICATION_CREDENTIALS.indexOf('config/voice/google-cloud.json') === -1) { log.warning(`The "GOOGLE_APPLICATION_CREDENTIALS" env variable is already settled with the following value: "${process.env.GOOGLE_APPLICATION_CREDENTIALS}"`) } diff --git a/test/e2e/nlp-modules.spec.js b/test/e2e/nlp-modules.spec.js index 775c766d..4dca7e65 100644 --- a/test/e2e/nlp-modules.spec.js +++ b/test/e2e/nlp-modules.spec.js @@ -19,8 +19,7 @@ describe('NLU modules', () => { const { langs } = JSON.parse(fs.readFileSync(path.join(global.paths.root, 'core', 'langs.json'), 'utf8')) const langKeys = Object.keys(langs) const packages = fs.readdirSync(global.paths.packages) - .filter(entity => - fs.statSync(path.join(global.paths.packages, entity)).isDirectory()) + .filter((entity) => fs.statSync(path.join(global.paths.packages, entity)).isDirectory()) for (let i = 0; i < langKeys.length; i += 1) { // eslint-disable-next-line no-loop-func diff --git a/test/json/is-valid.spec.js b/test/json/is-valid.spec.js index 2e02df05..59e7bbce 100644 --- a/test/json/is-valid.spec.js +++ b/test/json/is-valid.spec.js @@ -20,7 +20,7 @@ describe('are JSON files valid', () => { } else if (entities[i].indexOf('.json') !== -1) { const jsonFile = path.join(global.paths.root, dir, entities[i]) test(`${jsonFile} has valid JSON syntax`, () => { - try { + try { // eslint-disable-line no-useless-catch JSON.parse(fs.readFileSync(jsonFile, 'utf8')) expect(true).toBe(true) diff --git a/test/json/no-punctuation.spec.js b/test/json/no-punctuation.spec.js index 0c5be8f4..18f79ac1 100644 --- a/test/json/no-punctuation.spec.js +++ b/test/json/no-punctuation.spec.js @@ -6,7 +6,7 @@ describe('no punctuation', () => { 'server/src/data/expressions' ] const punctuations = ['.', ';', ':', '?', '!'] - const findPunctuation = s => punctuations.includes(s[s.length - 1]) + const findPunctuation = (s) => punctuations.includes(s[s.length - 1]) const findString = (iterable) => { const keys = Object.keys(iterable) @@ -33,8 +33,8 @@ describe('no punctuation', () => { const way = path.join(dir, entities[i]) if (fs.statSync(way).isDirectory()) { list(way) - } else if (entities[i].indexOf('.json') !== -1 && - entities[i].indexOf('classifier.json') === -1) { + } else if (entities[i].indexOf('.json') !== -1 + && entities[i].indexOf('classifier.json') === -1) { const jsonFile = path.join(global.paths.root, dir, entities[i]) const json = JSON.parse(fs.readFileSync(jsonFile, 'utf8')) diff --git a/test/json/punctuation.spec.js b/test/json/punctuation.spec.js index 6e00b056..66c3a2df 100644 --- a/test/json/punctuation.spec.js +++ b/test/json/punctuation.spec.js @@ -6,7 +6,7 @@ describe('punctuation', () => { 'packages' ] const punctuations = ['.', ';', ':', '?', '!', '>'] - const findPunctuation = s => punctuations.includes(s[s.length - 1]) + const findPunctuation = (s) => punctuations.includes(s[s.length - 1]) const findString = (iterable) => { const keys = Object.keys(iterable) @@ -33,8 +33,8 @@ describe('punctuation', () => { const way = path.join(dir, entities[i]) if (fs.statSync(way).isDirectory()) { list(way) - } else if (way.indexOf('data/answers') !== -1 && - entities[i].indexOf('.json') !== -1) { + } else if (way.indexOf('data/answers') !== -1 + && entities[i].indexOf('.json') !== -1) { const jsonFile = path.join(global.paths.root, dir, entities[i]) const json = JSON.parse(fs.readFileSync(jsonFile, 'utf8')) diff --git a/test/unit/server/core/ner.spec.js b/test/unit/server/core/ner.spec.js index c8fe8fe6..1eeefd3a 100644 --- a/test/unit/server/core/ner.spec.js +++ b/test/unit/server/core/ner.spec.js @@ -140,8 +140,8 @@ describe('NER', () => { expect(Ner.logExtraction).toHaveBeenCalledTimes(1) console.log('entities', entities) expect(entities.length).toBe(2) - expect(entities.map(e => e.entity)).toEqual(['start', 'animal']) - expect(entities.map(e => e.sourceText)).toEqual(['Please whistle as a', 'bird']) + expect(entities.map((e) => e.entity)).toEqual(['start', 'animal']) + expect(entities.map((e) => e.sourceText)).toEqual(['Please whistle as a', 'bird']) }) test('extracts regex custom entities', async () => { @@ -165,8 +165,8 @@ describe('NER', () => { expect(Ner.logExtraction).toHaveBeenCalledTimes(1) expect(entities.length).toBe(3) - expect(entities.map(e => e.entity)).toEqual(['color', 'color', 'color']) - expect(entities.map(e => e.sourceText)).toEqual(['blue', 'white', 'red']) + expect(entities.map((e) => e.entity)).toEqual(['color', 'color', 'color']) + expect(entities.map((e) => e.sourceText)).toEqual(['blue', 'white', 'red']) }) }) }) diff --git a/test/unit/server/core/nlu.spec.js b/test/unit/server/core/nlu.spec.js index 8d896978..da301a4c 100644 --- a/test/unit/server/core/nlu.spec.js +++ b/test/unit/server/core/nlu.spec.js @@ -97,7 +97,9 @@ describe('NLU', () => { } expect(Nlu.fallback(obj, [ - { words: ['query', 'example', 'test', 'fallbacks'], package: 'fake-pkg', module: 'fake-module', action: 'fake-action' } + { + words: ['query', 'example', 'test', 'fallbacks'], package: 'fake-pkg', module: 'fake-module', action: 'fake-action' + } ]).classification).toContainEntries([['package', 'fake-pkg'], ['module', 'fake-module'], ['action', 'fake-action'], ['confidence', 1]]) }) }) diff --git a/test/unit/server/stt/deepspeech/parser.spec.js b/test/unit/server/stt/deepspeech/parser.spec.js index 3a3b0605..93e454b4 100644 --- a/test/unit/server/stt/deepspeech/parser.spec.js +++ b/test/unit/server/stt/deepspeech/parser.spec.js @@ -4,8 +4,8 @@ import parser from '@/stt/deepspeech/parser' describe('DeepSpeech STT parser', () => { // Only run these tests if the models exist - if (fs.existsSync(`${global.paths.root}/bin/deepspeech/deepspeech.pbmm`) && - fs.existsSync(`${global.paths.root}/bin/deepspeech/deepspeech.scorer`)) { + if (fs.existsSync(`${global.paths.root}/bin/deepspeech/deepspeech.pbmm`) + && fs.existsSync(`${global.paths.root}/bin/deepspeech/deepspeech.scorer`)) { describe('init()', () => { test('returns error cannot find model', () => { expect(parser.init({