Skip to content

Commit

Permalink
fixed test file and removed the dot of generated readme in other env …
Browse files Browse the repository at this point in the history
…than dev
  • Loading branch information
GhomKrosmonaute committed Jun 6, 2024
1 parent 9a5e18e commit 5468921
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
3 changes: 3 additions & 0 deletions tests/index.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line no-undef
process.env.BOT_MODE = "test"

const app = await import("#app")
Expand All @@ -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)
}

0 comments on commit 5468921

Please sign in to comment.