Skip to content

Commit 6eb261c

Browse files
authored
fix(test): restore process.env after each test (#357)
1 parent 9259dfa commit 6eb261c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/cookie.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,17 @@ describe('cookie.ts', () => {
147147
});
148148

149149
describe('getJwtCookie', () => {
150+
const originalEnv = process.env;
151+
150152
beforeEach(() => {
151-
// Reset NODE_ENV for each test
153+
process.env = { ...originalEnv };
152154
delete process.env.NODE_ENV;
153155
});
154156

157+
afterEach(() => {
158+
process.env = originalEnv;
159+
});
160+
155161
it('should create JWT cookie with Secure flag for HTTPS URLs', async () => {
156162
const { getJwtCookie } = await import('./cookie');
157163

0 commit comments

Comments
 (0)