From c9619e1a1bd4d941b6e1226f374402b58ce50cd4 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Sat, 18 Jan 2025 20:45:01 +0100 Subject: [PATCH] chore(tests): fix type error in `data_dir.spec` --- src/services/data_dir.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/data_dir.spec.ts b/src/services/data_dir.spec.ts index 8192b8059..7ba31ea29 100644 --- a/src/services/data_dir.spec.ts +++ b/src/services/data_dir.spec.ts @@ -287,7 +287,7 @@ describe("data_dir.ts unit tests", async () => { const result = getDataDirs(`${mockValuePrefix}_TRILIUM_DATA_DIR`); for (const key in result) { - expect(result[key]).toEqual(`${mockValuePrefix}_${key}`); + expect(result[key as keyof typeof result]).toEqual(`${mockValuePrefix}_${key}`); } }); @@ -302,7 +302,7 @@ describe("data_dir.ts unit tests", async () => { const result = getDataDirs(mockDataDir); for (const key in result) { - expect(result[key].startsWith(mockDataDir)).toBeTruthy(); + expect(result[key as keyof typeof result].startsWith(mockDataDir)).toBeTruthy(); } mockFn.pathJoinMock.mockReset(); @@ -335,7 +335,7 @@ describe("data_dir.ts unit tests", async () => { if (typeof changeAttemptResult === "string") { // if it didn't throw above: assert that it did not change the value of it or any other keys of the object for (const key in result) { - expect(result[key].startsWith(mockDataDirBase)).toBeTruthy(); + expect(result[key as keyof typeof result].startsWith(mockDataDirBase)).toBeTruthy(); } } else { expect(changeAttemptResult).toBeInstanceOf(TypeError);