diff --git a/src/utils/temp_folder.test.ts b/src/utils/temp_folder.test.ts index 069b6516..c81b888b 100644 --- a/src/utils/temp_folder.test.ts +++ b/src/utils/temp_folder.test.ts @@ -1,7 +1,6 @@ import { expect } from 'chai'; import { cleanUpTempFolder, getTempFolder } from './temp_folder'; import * as fs from 'fs'; -import * as os from 'os'; describe('temp folder functions', () => { describe('getTempFolder function', () => { @@ -19,8 +18,7 @@ describe('temp folder functions', () => { it('returns a folder that contains the correct subfolders', () => { const tempFolderPath = getTempFolder(); - const expectedPathComponent = - os.platform() === 'win32' ? '\\ardrive-downloads' : '/.ardrive/ardrive-downloads'; + const expectedPathComponent = 'ardrive-downloads'; expect(tempFolderPath).to.contains(expectedPathComponent); }); }); diff --git a/src/utils/temp_folder.ts b/src/utils/temp_folder.ts index e8c8ec9b..6d682bb6 100644 --- a/src/utils/temp_folder.ts +++ b/src/utils/temp_folder.ts @@ -74,6 +74,6 @@ export function getTempFolder(): string { export function cleanUpTempFolder(): void { const tempFolderPath = platformTempFolder(); if (fs.existsSync(tempFolderPath)) { - fs.rmdirSync(tempFolderPath, { recursive: true }); + fs.rmSync(tempFolderPath, { recursive: true }); } }