Skip to content

Commit 7426245

Browse files
committed
relative file loading
1 parent 2ab9ce3 commit 7426245

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { join } from "node:path";
2-
import { cwd, loadEnvFile } from "node:process";
1+
import { dirname, join } from "node:path";
2+
import { loadEnvFile } from "node:process";
3+
import { fileURLToPath } from "node:url";
34

4-
loadEnvFile(join(cwd(), "tests", ".env"));
5+
const __dirname = dirname(fileURLToPath(import.meta.url));
6+
loadEnvFile(join(__dirname, ".env"));

0 commit comments

Comments
 (0)