File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,12 @@ let stop;
3636describe ( "API Routes" , ( ) => {
3737
3838 const originalEnv = process . env . NODE_ENV ;
39- const originalApiKey = process . env . OWM_API_KEY ;
39+ const originalOwmApiKey = process . env . OWM_API_KEY ;
40+ const originalWeatherApiKey = process . env . WEATHERAPI_API_KEY ;
41+
4042
4143 beforeAll ( async ( ) => {
42- process . env . OWM_API_KEY = 'test-key' ;
44+ process . env . OWM_API_KEY = process . env . WEATHERAPI_API_KEY = 'test-key' ;
4345 process . env . NODE_ENV = 'test' ;
4446 // import app after env is set and mocks registered
4547 const mod = await import ( "../index.mjs" ) ;
@@ -53,7 +55,8 @@ describe("API Routes", () => {
5355 } ) ;
5456
5557 afterAll ( async ( ) => {
56- process . env . OWM_API_KEY = originalApiKey ;
58+ process . env . OWM_API_KEY = originalOwmApiKey ;
59+ process . env . WEATHERAPI_API_KEY = originalWeatherApiKey ;
5760 process . env . NODE_ENV = originalEnv ;
5861 if ( stop ) await stop ( ) ;
5962 else if ( server && typeof server . close === 'function' ) await new Promise ( ( r ) => server . close ( r ) ) ;
You can’t perform that action at this time.
0 commit comments