From 5468921f2ab0994f15c0baa71be654a62e44cb74 Mon Sep 17 00:00:00 2001 From: GhomKrosmonaute Date: Thu, 6 Jun 2024 16:48:04 +0200 Subject: [PATCH] fixed test file and removed the dot of generated readme in other env than dev --- Gulpfile.js | 7 ++++++- tests/index.test.js | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Gulpfile.js b/Gulpfile.js index 3732831..d58927e 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -285,7 +285,12 @@ async function _generateReadme(cb) { return eval(key) }) - await fs.promises.writeFile(".readme.md", readme, "utf8") + await fs.promises.writeFile( + // eslint-disable-next-line no-undef + `${process.env.BOT_MODE === "dev" ? "." : ""}readme.md`, + readme, + "utf8", + ) cb() } diff --git a/tests/index.test.js b/tests/index.test.js index 1ee8a46..3fb955e 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line no-undef process.env.BOT_MODE = "test" const app = await import("#app") @@ -12,8 +13,10 @@ try { await app.checkUpdates() app.log("correctly started") + // eslint-disable-next-line no-undef process.exit(0) } catch (error) { app.error(error, "index", true) + // eslint-disable-next-line no-undef process.exit(1) }