Skip to content

Commit 6b68c92

Browse files
Merge pull request #1665 from bejewel-kyoungmin/fix-reset-env-correctly
test(@nestjs/config) reset env correctly
2 parents 7a7dc4d + 6498d2b commit 6b68c92

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tests/e2e/cache.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ describe('Cache', () => {
77
let app: INestApplication;
88
let envBackup: NodeJS.ProcessEnv;
99
beforeAll(() => {
10-
envBackup = process.env;
10+
envBackup = {
11+
...process.env,
12+
};
1113
});
1214
describe('without cache', () => {
1315
beforeAll(async () => {
@@ -56,7 +58,9 @@ describe('Cache', () => {
5658
});
5759

5860
afterEach(async () => {
59-
process.env = envBackup;
61+
process.env = {
62+
...envBackup,
63+
};
6064
await app.close();
6165
});
6266
});

tests/e2e/load-priority.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ describe('Environment variables and .env files', () => {
88
let app: INestApplication;
99
let envBackup: NodeJS.ProcessEnv;
1010
beforeAll(() => {
11-
envBackup = process.env;
11+
envBackup = {
12+
...process.env,
13+
};
1214
});
1315
describe('without conflicts', () => {
1416
beforeAll(async () => {
@@ -65,7 +67,9 @@ describe('Environment variables and .env files', () => {
6567
});
6668

6769
afterEach(async () => {
68-
process.env = envBackup;
70+
process.env = {
71+
...envBackup,
72+
};
6973
await app.close();
7074
});
7175
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy