mirror of
https://github.com/Cameri/nostream.git
synced 2025-07-14 15:52:23 +02:00
fix: SettingsStatic class default to yaml file (#158)
* fix: default to yaml file * fix: intg tests failing * fix: disable watch settings on tests * style: lix fint --------- Co-authored-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
This commit is contained in:
@ -37,8 +37,8 @@ export class App implements IRunnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public run(): void {
|
public run(): void {
|
||||||
this.watchers = SettingsStatic.watchSettings()
|
|
||||||
const settings = this.settings()
|
const settings = this.settings()
|
||||||
|
this.watchers = SettingsStatic.watchSettings()
|
||||||
console.log(`
|
console.log(`
|
||||||
███▄ █ ▒█████ ██████ ▄▄▄█████▓ ██▀███ ▓█████ ▄▄▄ ███▄ ▄███▓
|
███▄ █ ▒█████ ██████ ▄▄▄█████▓ ██▀███ ▓█████ ▄▄▄ ███▄ ▄███▓
|
||||||
██ ▀█ █ ▒██▒ ██▒▒██ ▒ ▓ ██▒ ▓▒▓██ ▒ ██▒▓█ ▀▒████▄ ▓██▒▀█▀ ██▒
|
██ ▀█ █ ▒██▒ ██▒▒██ ▒ ▓ ██▒ ▓▒▓██ ▒ ██▒▓█ ▀▒████▄ ▓██▒▀█▀ ██▒
|
||||||
|
@ -45,8 +45,12 @@ export class SettingsStatic {
|
|||||||
const filteredFile = files.find(fn => fn.startsWith('settings'))
|
const filteredFile = files.find(fn => fn.startsWith('settings'))
|
||||||
if (filteredFile) {
|
if (filteredFile) {
|
||||||
const extension = extname(filteredFile).substring(1)
|
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) {
|
public static loadSettings(path: string, fileType: SettingsFileTypes) {
|
||||||
|
@ -11,6 +11,7 @@ import {
|
|||||||
import { assocPath, pipe } from 'ramda'
|
import { assocPath, pipe } from 'ramda'
|
||||||
import { fromEvent, map, Observable, ReplaySubject, Subject, takeUntil } from 'rxjs'
|
import { fromEvent, map, Observable, ReplaySubject, Subject, takeUntil } from 'rxjs'
|
||||||
import WebSocket, { MessageEvent } from 'ws'
|
import WebSocket, { MessageEvent } from 'ws'
|
||||||
|
import Sinon from 'sinon'
|
||||||
|
|
||||||
import { connect, createIdentity, createSubscription, sendEvent } from './helpers'
|
import { connect, createIdentity, createSubscription, sendEvent } from './helpers'
|
||||||
import { getMasterDbClient, getReadReplicaDbClient } from '../../../src/database/client'
|
import { getMasterDbClient, getReadReplicaDbClient } from '../../../src/database/client'
|
||||||
@ -38,7 +39,7 @@ BeforeAll({ timeout: 1000 }, async function () {
|
|||||||
dbClient = getMasterDbClient()
|
dbClient = getMasterDbClient()
|
||||||
rrDbClient = getReadReplicaDbClient()
|
rrDbClient = getReadReplicaDbClient()
|
||||||
await dbClient.raw('SELECT 1=1')
|
await dbClient.raw('SELECT 1=1')
|
||||||
|
Sinon.stub(SettingsStatic, 'watchSettings')
|
||||||
const settings = SettingsStatic.createSettings()
|
const settings = SettingsStatic.createSettings()
|
||||||
|
|
||||||
SettingsStatic._settings = pipe(
|
SettingsStatic._settings = pipe(
|
||||||
|
Reference in New Issue
Block a user