2023-10-23 15:52:21 +00:00
|
|
|
import { IStorageRepository, StorageCore } from '@app/domain';
|
|
|
|
|
|
|
|
export const newStorageRepositoryMock = (reset = true): jest.Mocked<IStorageRepository> => {
|
|
|
|
if (reset) {
|
|
|
|
StorageCore.reset();
|
|
|
|
}
|
2023-02-03 15:16:25 +00:00
|
|
|
|
|
|
|
return {
|
2023-06-30 16:24:28 +00:00
|
|
|
createZipStream: jest.fn(),
|
2023-02-03 15:16:25 +00:00
|
|
|
createReadStream: jest.fn(),
|
2023-09-27 18:44:51 +00:00
|
|
|
readFile: jest.fn(),
|
|
|
|
writeFile: jest.fn(),
|
2023-02-25 14:12:03 +00:00
|
|
|
unlink: jest.fn(),
|
2023-05-26 19:43:24 +00:00
|
|
|
unlinkDir: jest.fn().mockResolvedValue(true),
|
2023-02-25 14:12:03 +00:00
|
|
|
removeEmptyDirs: jest.fn(),
|
|
|
|
checkFileExists: jest.fn(),
|
|
|
|
mkdirSync: jest.fn(),
|
2023-03-22 02:49:19 +00:00
|
|
|
checkDiskUsage: jest.fn(),
|
2023-08-02 01:56:10 +00:00
|
|
|
readdir: jest.fn(),
|
2023-09-20 11:16:33 +00:00
|
|
|
stat: jest.fn(),
|
|
|
|
crawl: jest.fn(),
|
2023-12-29 18:41:33 +00:00
|
|
|
rename: jest.fn(),
|
|
|
|
copyFile: jest.fn(),
|
2024-01-31 08:15:54 +00:00
|
|
|
watch: jest.fn(),
|
2024-02-12 04:40:34 +00:00
|
|
|
utimes: jest.fn(),
|
2023-02-03 15:16:25 +00:00
|
|
|
};
|
|
|
|
};
|