0
votes

I am working on a React app bootstraped from create-react-app few years ago.

The app has a .env.dev file with many variables. The start script is "start": "env-cmd -f .env.dev --use-shell \"react-scripts start\"",

React script version: "react-scripts": "^4.0.1",

When I console.log("gggg", process.env); I get all the variables. When I:

describe('Login via API', () => {
  it('Test login', () => {
    console.log('teeest', process.env)
    cy.login()
  })
})

instead I get an empty object.

Can anyone please help me to understand what's wrong? How can I make it work?

Thanks