Skip to content

Commit

Permalink
test: read env file with loadEnv
Browse files Browse the repository at this point in the history
Signed-off-by: Raphael Arce <raphael.arce@ts.berlin>
  • Loading branch information
raphael-arce committed Oct 14, 2024
1 parent 3ef3b9e commit 8eba51a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { defineConfig, devices } from "@playwright/test";
import { loadEnv } from "vite";

/**
* in the CI pipeline, the env variables are provided by the CI, not the .env file
*/
if (!process.env.CI) {
process.env = { ...process.env, ...loadEnv("", process.cwd()) };
}

const port = process.env.VITE_PORT ? parseInt(process.env.VITE_PORT) : 5173;

Expand Down

0 comments on commit 8eba51a

Please sign in to comment.