diff --git a/e2e-tests/e2eTestTools.js b/e2e-tests/clearTestingData.js similarity index 54% rename from e2e-tests/e2eTestTools.js rename to e2e-tests/clearTestingData.js index 9350b7229..2adcf8a56 100644 --- a/e2e-tests/e2eTestTools.js +++ b/e2e-tests/clearTestingData.js @@ -4,20 +4,6 @@ const fs = require('fs'); const baseDir = path.join(os.homedir(), '.dbgate'); -// function createTimeStamp() { -// const now = new Date(); -// const year = now.getFullYear(); -// const month = String(now.getMonth() + 1).padStart(2, '0'); // měsíc je 0-indexovaný -// const day = String(now.getDate()).padStart(2, '0'); -// const hours = String(now.getHours()).padStart(2, '0'); -// const minutes = String(now.getMinutes()).padStart(2, '0'); -// const seconds = String(now.getSeconds()).padStart(2, '0'); - -// // Poskládáme datum a čas do názvu souboru -// const ts = `${year}-${month}-${day}_${hours}-${minutes}-${seconds}`; -// return ts; -// } - function clearTestingData() { if (fs.existsSync(path.join(baseDir, 'connections-e2etests.jsonl'))) { fs.unlinkSync(path.join(baseDir, 'connections-e2etests.jsonl')); @@ -31,8 +17,9 @@ function clearTestingData() { if (fs.existsSync(path.join(baseDir, 'archive-e2etests'))) { fs.rmdirSync(path.join(baseDir, 'archive-e2etests'), { recursive: true }); } + if (fs.existsSync(path.join(__dirname, '../my_guitar_shop.db'))) { + fs.unlinkSync(path.join(__dirname, '../my_guitar_shop.db')); + } } -module.exports = { - clearTestingData, -}; +clearTestingData();