The current API lib is used on both the server (SSR) and the client side. I currently use process.env.PORT to see if the code is executed on client or server in order to get the API address.
apiAddress = (process.env.PORT) ? `http://127.0.0.1:${process.env.PORT}/api/users` : '/api/users'
The problem is that when executing the tests, the process.env.PORT is undefined.
The current API lib is used on both the server (SSR) and the client side. I currently use process.env.PORT to see if the code is executed on client or server in order to get the API address.
apiAddress = (process.env.PORT) ? `http://127.0.0.1:${process.env.PORT}/api/users` : '/api/users'The problem is that when executing the tests, the
process.env.PORTis undefined.