feat: add desktop repo (#1071)
This commit is contained in:
21
packages/desktop/test/testUtils.ts
Normal file
21
packages/desktop/test/testUtils.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import path from 'path'
|
||||
import { deleteDir, ensureDirectoryExists } from '../app/javascripts/Main/Utils/FileUtils'
|
||||
|
||||
export function createTmpDir(name: string): {
|
||||
path: string
|
||||
make(): Promise<string>
|
||||
clean(): Promise<void>
|
||||
} {
|
||||
const tmpDirPath = path.join(__dirname, 'data', 'tmp', path.basename(name))
|
||||
|
||||
return {
|
||||
path: tmpDirPath,
|
||||
async make() {
|
||||
await ensureDirectoryExists(tmpDirPath)
|
||||
return tmpDirPath
|
||||
},
|
||||
async clean() {
|
||||
await deleteDir(tmpDirPath)
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user