Skip to content

Port number set in env.test is ignored #4794

@nadlgit

Description

@nadlgit

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

Metadata

Metadata

Assignees

Labels

Type: BugThe issue has indentified a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions