Hi all. I'm currently migrating a Cypress project ...
# help
c
Hi all. I'm currently migrating a Cypress project from version 6.5 to 10.0. I have some problems migrating the
plugins/index.js
file. The old file looks as follows.
Copy code
const fs = require('fs-extra')
const path = require('path')

module.exports = (on, config) => {
  const file = config.env.configFile || 'development'
  const pathToConfigFile = path.resolve('config', `${file}.json`)
  return fs.readJson(pathToConfigFile)
}
Where the config files look as follows.
Copy code
{
  "baseUrl": "https://local.example.com",
  "cypressEnv": "local",
  "gtmId": "ID-666",
  "video": false
}
I had a look at the migration guide and it seems that I have to move this logic into the
setupNodeEvents()
function. However, I have no idea how to set for example
baseUrl
and
cypressEnv
inside
setupNodeEvents()
. Any help would be appreciated.
3 Views