AdonisJS is a TypeScript-first web framework for building web apps and API servers. It comes with support for testing, modern tooling, an ecosystem of official packages, and more.
When using a separate env file for tests (env.test or env.test.local), the PORT variable is ignored and instead the value for default env file is used. For example, if we set 3333 in .env and 3334 in .env.test, 3333 is still used during test runs.
It seems to me that PORT is the only one ignored and other variables are correctly set.
The workaround proposed in above Discord feed works: setting conditionally process.env.NODE_ENV to 'test' inside bin/console.ts. But I think it's a bit awkward.
Package version
6.14.1
Describe the bug
I have same issue as described in this Discord feed: https://discord.com/channels/423256550564691970/1293218007253909504.
When using a separate env file for tests (env.test or env.test.local), the PORT variable is ignored and instead the value for default env file is used. For example, if we set 3333 in .env and 3334 in .env.test, 3333 is still used during test runs.
It seems to me that PORT is the only one ignored and other variables are correctly set.
The workaround proposed in above Discord feed works: setting conditionally process.env.NODE_ENV to 'test' inside bin/console.ts. But I think it's a bit awkward.
Reproduction repo
No response