mirror of
https://github.com/sasjs/server.git
synced 2026-07-23 21:25:29 +00:00
dec5191491
drive.spec.ts already isolates itself into a unique, timestamped tmpFolder for getSasjsRootFolder()/getUploadsFolder(), cleaned up via afterAll(() => deleteFolder(tmpFolder)). But getFilesFolder() - what nearly every test in this file actually writes to - resolves through a separate, unmocked function (getSasjsDriveFolder()/process.driveLoc), so every run left real files/folders (e.g. 'level1', 'my/path/...') behind in the shared api/sasjs_root/drive/files, causing later runs to fail: folder-listing tests saw stale entries, and file-creation tests got 409 Conflict against files a previous run already created. Mock getFilesFolder() the same way getUploadsFolder() already is, so it resolves inside the same isolated tmpFolder and gets cleaned up by the existing afterAll. Verified by running the suite twice in a row from a clean slate: both runs pass, and the real sasjs_root/drive is never touched.