mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-05 14:09:46 -06:00
fix: warn on EPERM for project directory just like EACCES (#16934)
This commit is contained in:
@@ -167,7 +167,7 @@ Search [all issues](https://github.com/cypress-io/cypress/issues) for keywords f
|
||||
If an issue already exists you should:
|
||||
|
||||
- Thank them for their contribution.
|
||||
- Explain that this issue if a duplicate of another issue, linking to the relevant issue (`#1234`).
|
||||
- Explain that this issue is a duplicate of another issue, linking to the relevant issue (`#1234`).
|
||||
- Add the `type: duplicate` label to the issue.
|
||||
- Close the issue.
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ module.exports = {
|
||||
log('cannot find file %s', file)
|
||||
|
||||
return this._err('CONFIG_FILE_NOT_FOUND', this.configFile(options), projectRoot)
|
||||
}).catch({ code: 'EACCES' }, () => {
|
||||
}).catch({ code: 'EACCES' }, { code: 'EPERM' }, () => {
|
||||
// we cannot write due to folder permissions
|
||||
return errors.warning('FOLDER_NOT_WRITABLE', projectRoot)
|
||||
}).catch((err) => {
|
||||
|
||||
@@ -806,7 +806,7 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
})
|
||||
})
|
||||
|
||||
it('bubbles up Settings.read errors', function () {
|
||||
it('bubbles up Settings.read EACCES error', function () {
|
||||
const err = new Error()
|
||||
|
||||
err.code = 'EACCES'
|
||||
@@ -820,6 +820,21 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
|
||||
expect(err.code).to.eq('EACCES')
|
||||
})
|
||||
})
|
||||
|
||||
it('bubbles up Settings.read EPERM error', function () {
|
||||
const err = new Error()
|
||||
|
||||
err.code = 'EPERM'
|
||||
|
||||
sinon.stub(settings, 'read').rejects(err)
|
||||
|
||||
return this.project.getProjectId()
|
||||
.then((id) => {
|
||||
throw new Error('expected to fail, but did not')
|
||||
}).catch((err) => {
|
||||
expect(err.code).to.eq('EPERM')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
context('#writeProjectId', () => {
|
||||
|
||||
Reference in New Issue
Block a user