Merge pull request #1015 from TriliumNext/test_fix-flaky-getPlatformAppDataDir

test(data_dir): fix flaky getPlatformAppDataDir test on Windows
This commit is contained in:
Elian Doran 2025-01-20 20:50:26 +02:00 committed by GitHub
commit d2c2d945aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,6 +77,11 @@ describe("data_dir.ts unit tests", async () => {
["w/ darwin it should return '~/Library/Application Support'", ["darwin", undefined], "/Users/mock/Library/Application Support", "/Users/mock"]
];
beforeEach(() => {
// make sure OS does not set its own process.env.APPDATA, so that we can use our own supplied value
delete process.env.APPDATA;
});
testCases.forEach((testCase) => {
const [testDescription, fnValues, expected, osHomedirMockValue] = testCase;
return it(testDescription, () => {