From 2e749e3d7cd6a9b263e9d9b7fb9c7d9f649638b6 Mon Sep 17 00:00:00 2001 From: adrianromanski Date: Fri, 20 Dec 2024 16:05:09 +0100 Subject: [PATCH] tests: change hardcoded env set to vi.stubEnv --- projects/nx-verdaccio/src/plugin/caching.unit-test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/nx-verdaccio/src/plugin/caching.unit-test.ts b/projects/nx-verdaccio/src/plugin/caching.unit-test.ts index a493633..e1117a7 100644 --- a/projects/nx-verdaccio/src/plugin/caching.unit-test.ts +++ b/projects/nx-verdaccio/src/plugin/caching.unit-test.ts @@ -100,13 +100,13 @@ describe('readTargetsCache', (): void => { .mockImplementation((): Record> => { return MOCK_TARGETS_CACHE; }); - process.env.NX_CACHE_PROJECT_GRAPH = 'true'; + vi.stubEnv("NX_CACHE_PROJECT_GRAPH", 'true') }); afterEach((): void => { existsSyncSpy.mockRestore(); readJsonFileSpy.mockRestore(); - delete process.env.NX_CACHE_PROJECT_GRAPH; + vi.clearAllMocks(); }); it('should call existSync once with correct argument', (): void => {