Skip to content

Commit

Permalink
Added test for writeerror on read-only manifest.
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianba committed Nov 28, 2016
1 parent 5085fe3 commit 3c78134
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,25 @@ describe('Testing incrementVersion',function() {
});
});
});
it('should work fail with writeerror with readonly manifest when overwrite is requested',function(done) {
var tempXml = path.join(__dirname,'testfiles/tmp.xml');
fs.copy(path.join(__dirname,'testfiles/valid.xml'),tempXml,function(err) {
assert.ifError(err);
fs.chmodSync(tempXml,'444');
versionUpdate.incrementVersionFile(tempXml,true)
.then(data => {
fs.chmodSync(tempXml,'666');
fs.removeSync(tempXml);
done('Unexpected success.');
})
.catch(e => {
assert.equal(e.status,"writeerror");
fs.chmodSync(tempXml,'666');
fs.removeSync(tempXml);
done();
});
});
});
it('should fail with command line if manifest is missing',function(done) {
var testCommand = "node " + path.join(__dirname,'../cmd/commandLine.js');
exec(testCommand, (err,stdout,stderr) => {
Expand Down

0 comments on commit 3c78134

Please sign in to comment.