* added tests for fs.promises.chown() for check if function exists and updating gid/uid for a file * update to pass lint tests * cleaned up code. replaced all callbacks with promises in new test. * Revert "lint tests fix" This reverts commit3c256124cf
, reversing changes made to71a6f514fc
. * Revert "cleaned up code. replaced all callbacks with promises in new test." This reverts commit71a6f514fc
. * Made requested changes.
This commit is contained in:
parent
1eab5f0ffd
commit
3bbabfcb4a
|
@ -62,3 +62,27 @@ describe('fs.chown, fs.fchown', function() {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('fs.promises.chown', function(){
|
||||
beforeEach(util.setup);
|
||||
afterEach(util.setup);
|
||||
|
||||
it('should be a function', function(){
|
||||
var fsPromises = util.fs().promises;
|
||||
expect(fsPromises.chown).to.be.a('function');
|
||||
});
|
||||
|
||||
it('should allow updating uid and gid for a file', function() {
|
||||
var fsPromises = util.fs().promises;
|
||||
return fsPromises.writeFile('/file', 'data')
|
||||
.then(() =>
|
||||
fsPromises.chown('/file', 500, 500))
|
||||
.then(() =>
|
||||
fsPromises.stat('/file'))
|
||||
.then((stats) =>{
|
||||
expect(stats.uid).to.equal(500);
|
||||
expect(stats.gid).to.equal(500);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue