From ea359488b62a67a46fe4f11595e06885aab6ee85 Mon Sep 17 00:00:00 2001 From: Sylvain Duchesne Date: Mon, 2 Nov 2026 21:50:24 +0100 Subject: [PATCH] Load the backend's env files from its own directory The root `bun test` also runs the backend's tests, from the repository root, where dotenv-flow found no backend/.env: they passed only while the root .env still carried stale SEMAPPS_* lines, and failed on a clean one (HOME_URL undefined). --- backend/config/config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/config/config.js b/backend/config/config.js index 5bd9deb..48aac29 100644 --- a/backend/config/config.js +++ b/backend/config/config.js @@ -1,4 +1,6 @@ -require('dotenv-flow').config(); +// The backend's own env files, wherever the process starts: the root `bun test` runs the +// backend's tests too, from the repository root. +require('dotenv-flow').config({ path: require('path').join(__dirname, '..') }); module.exports = { APP_NAME: process.env.SEMAPPS_APP_NAME,