I have an environmental variable that comes from a .env file that gets compiled from a env.config.js. I have used this approach: https://www.freecodecamp.org/news/how-to-implement-runtime-environment-variables-with-create-react-app-docker-and-nginx-7f9d42a91d70/
I am using as below:
const url = `${window._env_.REACT_APP_URL}`
All seems to be working, however in my test console Jest is flagging by saying:
TypeError: Cannot read property 'REACT_APP_URL' of undefined
Any idea's why?