blob: 8ad03e17ae2e050fa389f55af5d1dc0e8ff947f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
use std::{env::current_dir, path::PathBuf};
use tokio::fs;
#[cfg(test)]
pub mod test_vault_setup_and_member_register;
#[cfg(test)]
pub mod test_virtual_file_creation_and_update;
#[cfg(test)]
pub mod test_local_workspace_setup_and_account_management;
#[cfg(test)]
pub mod test_sheet_creation_management_and_persistence;
pub async fn get_test_dir(area: &str) -> Result<PathBuf, std::io::Error> {
let dir = current_dir()?.join(".temp").join("test").join(area);
if !dir.exists() {
std::fs::create_dir_all(&dir)?;
} else {
// Regenerate existing directory
fs::remove_dir_all(&dir).await?;
fs::create_dir_all(&dir).await?;
}
Ok(dir)
}
|