We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20b3080 commit 592ef22Copy full SHA for 592ef22
test/env.test.js
@@ -1,6 +1,6 @@
1
const assert = require("assert");
2
const {
3
- promises: { stat },
+ promises: { stat, readFile },
4
F_OK
5
} = require("fs");
6
const path = require("path");
@@ -17,4 +17,17 @@ describe(".env", () => {
17
});
18
assert.ok(hasEnv);
19
20
+ // 6.2
21
+ it("should be ignored in the .gitignore file", async () => {
22
+ const gitIgnorePath = path.join(process.cwd(), ".gitignore");
23
+ const gitIgnoreFile = await readFile(gitIgnorePath, "utf8");
24
+ const lines = gitIgnoreFile.split("\n");
25
+ let hasMatch = false;
26
+ for (const line of lines) {
27
+ if (line.match(/^.env/)) {
28
+ hasMatch = true;
29
+ }
30
31
+ assert.ok(hasMatch, ".env is not added to the .gitignore file");
32
+ });
33
0 commit comments