Project A (working):
cy.request(`${Cypress.env('mainnet')}api?module=account&action=txlist&address=${ethWallet}&startblock=0&endblock=99999999&page=1&offset=10&sort=asc&apikey=${process.env.apiKey}`).then((response) => {
.env File:
apiKey=YOUR_KEY_HERE
Project B (not working):
const key = process.env.apiKey
const token = process.env.authToken
Cypress.Commands.add('createBoard', (name) => {
cy
.request('POST', 'boards', { name, key: process.env.apiKey, token: process.env.authToken })
.then(({ body }) => {
Cypress.env('boards').push(body)
})
})
.env File:
apiKey=MY_KEY
authToken=MY_TOKEN
Both projects have the same packages and a correct .env file setup. So why in project B do I keep getting undefined? It makes no sense at all.