forked from cloudron-apps/gitea-app
Add custom file test
This commit is contained in:
parent
b16095eef5
commit
3eb57f2c07
1 changed files with 20 additions and 0 deletions
20
test/test.js
20
test/test.js
|
@ -218,6 +218,23 @@ return done();
|
|||
done();
|
||||
}
|
||||
|
||||
function addCustomFile(done) {
|
||||
fs.writeFileSync('/tmp/customfile.txt', 'GOGS TEST', 'utf8');
|
||||
execSync('cloudron exec -- mkdir -p /app/data/custom/public');
|
||||
execSync('cloudron push /tmp/customfile.txt /app/data/custom/public/customfile.txt');
|
||||
fs.unlinkSync('/tmp/customfile.txt');
|
||||
done();
|
||||
}
|
||||
|
||||
function checkCustomFile(done) {
|
||||
superagent.get('https://' + app.fqdn + '/customfile.txt').end(function (error, result) {
|
||||
if (error) return done(error);
|
||||
|
||||
expect(result.text).to.contain('GOGS TEST');
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function fileExists() {
|
||||
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
|
||||
}
|
||||
|
@ -294,6 +311,9 @@ return done();
|
|||
it('can add and push a file', pushFile);
|
||||
it('can edit file', editFile);
|
||||
|
||||
it('can add custom file', addCustomFile);
|
||||
it('can check custom file', checkCustomFile);
|
||||
|
||||
it('can restart app', function (done) {
|
||||
execSync('cloudron restart --wait --app ' + app.id);
|
||||
done();
|
||||
|
|
Loading…
Reference in a new issue