-
Notifications
You must be signed in to change notification settings - Fork 936
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #1774, improve access errors and warn when sudo is used
- Loading branch information
1 parent
f36b898
commit dd83e35
Showing
4 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expect } from 'chai'; | ||
import Helper from '../e2e-helper'; | ||
|
||
describe('permissions', function () { | ||
this.timeout(0); | ||
const helper = new Helper(); | ||
after(() => { | ||
helper.destroyEnv(); | ||
}); | ||
describe('adding a component with sudo', () => { | ||
before(() => { | ||
helper.reInitLocalScope(); | ||
helper.createComponentBarFoo(); | ||
const output = helper.runCmd('sudo bit add bar/foo.js'); | ||
expect(output).to.have.string('Warning'); | ||
expect(output).to.have.string('root'); | ||
}); | ||
describe('tagging the same component without sudo', () => { | ||
it('should show a descriptive error', () => { | ||
const output = helper.runWithTryCatch('bit tag -a'); | ||
expect(output).to.have.string('error: you do not have permissions to access'); | ||
expect(output).to.have.string('were you running bit, npm or git as root'); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters