mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-24 07:59:12 -05:00
fix: --config-file can now handle absolute paths. (#16746)
Co-authored-by: Guillaume Viguier guillaume.viguier-just@propulse-lab.com
This commit is contained in:
@@ -58,7 +58,7 @@ const renameSupportFolder = (obj) => {
|
||||
|
||||
module.exports = {
|
||||
_pathToFile (projectRoot, file) {
|
||||
return path.join(projectRoot, file)
|
||||
return path.isAbsolute(file) ? file : path.join(projectRoot, file)
|
||||
},
|
||||
|
||||
_err (type, file, err) {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
require('../../spec_helper')
|
||||
const setting = require(`../../../lib/util/settings`)
|
||||
|
||||
describe('lib/util/settings', () => {
|
||||
describe('pathToConfigFile', () => {
|
||||
it('supports relative path', () => {
|
||||
const path = setting.pathToConfigFile('/users/tony/cypress', {
|
||||
configFile: 'e2e/config.json',
|
||||
})
|
||||
|
||||
expect(path).to.equal('/users/tony/cypress/e2e/config.json')
|
||||
})
|
||||
|
||||
it('supports absolute path', () => {
|
||||
const path = setting.pathToConfigFile('/users/tony/cypress', {
|
||||
configFile: '/users/pepper/cypress/e2e/cypress.config.json',
|
||||
})
|
||||
|
||||
expect(path).to.equal('/users/pepper/cypress/e2e/cypress.config.json')
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user