refactor: improve project loading

This commit is contained in:
Carlos Valente
2025-03-29 21:57:30 +01:00
committed by arc-alex
parent fc4c1bf22e
commit 5c6b06a0d4
17 changed files with 137 additions and 173 deletions
@@ -23,6 +23,9 @@ type ReadonlyPromise<T> = Promise<Readonly<T>>;
let db = {} as Low<DatabaseModel>;
/**
* Initialises the JSON adapter to persist data to a file
*/
export async function initPersistence(filePath: string, fallbackData: DatabaseModel) {
// eslint-disable-next-line no-unused-labels -- dev code path
DEV: shouldCrashDev(!isPath(filePath), 'initPersistence should be called with a path');
@@ -127,7 +127,6 @@ describe('safeMerge', () => {
} as Settings,
});
expect(mergedData.settings).toStrictEqual({
app: 'ontime',
version: 'new',
serverPort: 3000,
operatorKey: null,