Skip to content

Commit

Permalink
Fix the directory path
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Feb 8, 2024
1 parent c69eb6a commit b3972b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions scripts/vitest/setupFiles/dotenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import path from "node:path";
// It's a dev dependency
// eslint-disable-next-line import/no-extraneous-dependencies
import {config} from "dotenv";
const currentDir = new URL(".", import.meta.url).pathname;
// eslint-disable-next-line @typescript-eslint/naming-convention
const __dirname = new URL(".", import.meta.url).pathname;

config({path: path.join(currentDir, "../../../.env.test"), debug: true});
config({path: path.join(__dirname, "../../../.env.test")});
6 changes: 3 additions & 3 deletions vitest.base.unit.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import {defineConfig} from "vitest/config";
const currentDir = new URL(".", import.meta.url).pathname;
const __dirname = new URL(".", import.meta.url).pathname;

export default defineConfig({
test: {
Expand All @@ -15,8 +15,8 @@ export default defineConfig({
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
],
setupFiles: [
path.join(currentDir, "./scripts/vitest/setupFiles/customMatchers.ts"),
path.join(currentDir, "./scripts/vitest/setupFiles/dotenv.ts"),
path.join(__dirname, "./scripts/vitest/setupFiles/customMatchers.ts"),
path.join(__dirname, "./scripts/vitest/setupFiles/dotenv.ts"),
],
reporters: ["default", "hanging-process"],
coverage: {
Expand Down

0 comments on commit b3972b6

Please sign in to comment.