backend-test-utils: make sure MockDirectory contents are created with full permissions

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-09-22 13:53:20 +02:00
parent 587644c044
commit a71dbf4b34
@@ -244,10 +244,10 @@ export class MockDirectory {
}
if (entry.type === 'dir') {
fs.ensureDirSync(fullPath);
fs.ensureDirSync(fullPath, { mode: 0o777 });
} else if (entry.type === 'file') {
fs.ensureDirSync(dirname(fullPath));
fs.writeFileSync(fullPath, entry.content);
fs.ensureDirSync(dirname(fullPath), { mode: 0o777 });
fs.writeFileSync(fullPath, entry.content, { mode: 0o666 });
}
}
}