diff --git a/src/app/app.ts b/src/app/app.ts index 058e05f7..7e02cbbc 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -37,8 +37,8 @@ export class App implements IRunnable { } public run(): void { - this.watchers = SettingsStatic.watchSettings() const settings = this.settings() + this.watchers = SettingsStatic.watchSettings() console.log(` ███▄ █ ▒█████ ██████ ▄▄▄█████▓ ██▀███ ▓█████ ▄▄▄ ███▄ ▄███▓ ██ ▀█ █ ▒██▒ ██▒▒██ ▒ ▓ ██▒ ▓▒▓██ ▒ ██▒▓█ ▀▒████▄ ▓██▒▀█▀ ██▒ diff --git a/src/utils/settings.ts b/src/utils/settings.ts index e9e226e7..55092c33 100644 --- a/src/utils/settings.ts +++ b/src/utils/settings.ts @@ -45,8 +45,12 @@ export class SettingsStatic { const filteredFile = files.find(fn => fn.startsWith('settings')) if (filteredFile) { const extension = extname(filteredFile).substring(1) - return SettingsFileTypes[extension] + if (SettingsFileTypes[extension]) { + return SettingsFileTypes[extension] + } } + + return SettingsFileTypes.yaml } public static loadSettings(path: string, fileType: SettingsFileTypes) { diff --git a/test/integration/features/shared.ts b/test/integration/features/shared.ts index 44df25f8..38aaa854 100644 --- a/test/integration/features/shared.ts +++ b/test/integration/features/shared.ts @@ -11,6 +11,7 @@ import { import { assocPath, pipe } from 'ramda' import { fromEvent, map, Observable, ReplaySubject, Subject, takeUntil } from 'rxjs' import WebSocket, { MessageEvent } from 'ws' +import Sinon from 'sinon' import { connect, createIdentity, createSubscription, sendEvent } from './helpers' import { getMasterDbClient, getReadReplicaDbClient } from '../../../src/database/client' @@ -38,7 +39,7 @@ BeforeAll({ timeout: 1000 }, async function () { dbClient = getMasterDbClient() rrDbClient = getReadReplicaDbClient() await dbClient.raw('SELECT 1=1') - + Sinon.stub(SettingsStatic, 'watchSettings') const settings = SettingsStatic.createSettings() SettingsStatic._settings = pipe(