mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-09 17:52:32 +08:00
test(data_dir): fix flaky getPlatformAppDataDir test on Windows
Delete the provided process.env.APPDATA on Windows, so that we can use our own values (one of which is "undefined", which was causing the getPlatformAppDataDir to fallback to the "real" process.env.APPDATA -> causing failing test, when run on Windows
This commit is contained in:
parent
7f15f8a7de
commit
ca8146413a
@ -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, () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user