mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
chore(tests): fix type error in data_dir.spec
This commit is contained in:
parent
121e7b33ec
commit
c9619e1a1b
@ -287,7 +287,7 @@ describe("data_dir.ts unit tests", async () => {
|
|||||||
const result = getDataDirs(`${mockValuePrefix}_TRILIUM_DATA_DIR`);
|
const result = getDataDirs(`${mockValuePrefix}_TRILIUM_DATA_DIR`);
|
||||||
|
|
||||||
for (const key in result) {
|
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);
|
const result = getDataDirs(mockDataDir);
|
||||||
|
|
||||||
for (const key in result) {
|
for (const key in result) {
|
||||||
expect(result[key].startsWith(mockDataDir)).toBeTruthy();
|
expect(result[key as keyof typeof result].startsWith(mockDataDir)).toBeTruthy();
|
||||||
}
|
}
|
||||||
|
|
||||||
mockFn.pathJoinMock.mockReset();
|
mockFn.pathJoinMock.mockReset();
|
||||||
@ -335,7 +335,7 @@ describe("data_dir.ts unit tests", async () => {
|
|||||||
if (typeof changeAttemptResult === "string") {
|
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
|
// 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) {
|
for (const key in result) {
|
||||||
expect(result[key].startsWith(mockDataDirBase)).toBeTruthy();
|
expect(result[key as keyof typeof result].startsWith(mockDataDirBase)).toBeTruthy();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
expect(changeAttemptResult).toBeInstanceOf(TypeError);
|
expect(changeAttemptResult).toBeInstanceOf(TypeError);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user