Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. // cypress/plugins/index.js
  2. const fs = require('fs-extra')
  3. const path = require('path')
  4.  
  5. function getConfigurationByFile(file) {
  6. const pathToConfigFile = path.resolve('cypress/', 'config', `${file}.json`)
  7.  
  8. return fs.readJson(pathToConfigFile)
  9. }
  10.  
  11. module.exports = (on, config) => {
  12. // accept a configFile value or use dev by default
  13. const file = config.env.configFile || 'dev'
  14.  
  15. return getConfigurationByFile(file)
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement