Skip to content
Snippets Groups Projects
Unverified Commit 3069da5d authored by Nicolò Pretto's avatar Nicolò Pretto Committed by GitHub
Browse files

reduce logs in cypress tests by checking before removing folder (#48043)

parent e66aad34
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,11 @@ const path = require("path");
const removeDirectory = path => {
try {
fs.rmdirSync(path, { maxRetries: 10, recursive: true });
if (fs.existsSync(path)) {
fs.rmdirSync(path, { maxRetries: 10, recursive: true });
} else {
console.log("Directory does not exist in `removeDirectory`:", path);
}
} catch (error) {
console.log("Error while removing directory", path, error);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment