merge domaindb.js into domains.js
This commit is contained in:
+18
-18
@@ -12,40 +12,40 @@ const apptask = require('../apptask.js'),
|
||||
paths = require('../paths.js'),
|
||||
_ = require('underscore');
|
||||
|
||||
const { APP } = common;
|
||||
|
||||
describe('apptask', function () {
|
||||
before(common.setup);
|
||||
after(common.cleanup);
|
||||
const { setup, cleanup, app } = common;
|
||||
|
||||
before(setup);
|
||||
after(cleanup);
|
||||
|
||||
it('create volume', function (done) {
|
||||
apptask._createAppDir(APP, function (error) {
|
||||
expect(fs.existsSync(paths.APPS_DATA_DIR + '/' + APP.id)).to.be(true);
|
||||
expect(fs.existsSync(paths.APPS_DATA_DIR + '/' + APP.id + '/data')).to.be(false);
|
||||
apptask._createAppDir(app, function (error) {
|
||||
expect(fs.existsSync(paths.APPS_DATA_DIR + '/' + app.id)).to.be(true);
|
||||
expect(fs.existsSync(paths.APPS_DATA_DIR + '/' + app.id + '/data')).to.be(false);
|
||||
expect(error).to.be(null);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('delete volume - removeDirectory (false) ', function (done) {
|
||||
apptask._deleteAppDir(APP, { removeDirectory: false }, function (error) {
|
||||
expect(fs.existsSync(paths.APPS_DATA_DIR + '/' + APP.id)).to.be(true);
|
||||
expect(fs.readdirSync(paths.APPS_DATA_DIR + '/' + APP.id).length).to.be(0); // empty
|
||||
apptask._deleteAppDir(app, { removeDirectory: false }, function (error) {
|
||||
expect(fs.existsSync(paths.APPS_DATA_DIR + '/' + app.id)).to.be(true);
|
||||
expect(fs.readdirSync(paths.APPS_DATA_DIR + '/' + app.id).length).to.be(0); // empty
|
||||
expect(error).to.be(null);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('delete volume - removeDirectory (true) ', function (done) {
|
||||
apptask._deleteAppDir(APP, { removeDirectory: true }, function (error) {
|
||||
expect(!fs.existsSync(paths.APPS_DATA_DIR + '/' + APP.id)).to.be(true);
|
||||
apptask._deleteAppDir(app, { removeDirectory: true }, function (error) {
|
||||
expect(!fs.existsSync(paths.APPS_DATA_DIR + '/' + app.id)).to.be(true);
|
||||
expect(error).to.be(null);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('barfs on empty manifest', function (done) {
|
||||
var badApp = _.extend({ }, APP);
|
||||
var badApp = _.extend({ }, app);
|
||||
badApp.manifest = { };
|
||||
|
||||
apptask._verifyManifest(badApp.manifest, function (error) {
|
||||
@@ -55,8 +55,8 @@ describe('apptask', function () {
|
||||
});
|
||||
|
||||
it('fails on bad manifest', function (done) {
|
||||
var badApp = _.extend({ }, APP);
|
||||
badApp.manifest = _.extend({ }, APP.manifest);
|
||||
var badApp = _.extend({ }, app);
|
||||
badApp.manifest = _.extend({ }, app.manifest);
|
||||
delete badApp.manifest.httpPort;
|
||||
|
||||
apptask._verifyManifest(badApp.manifest, function (error) {
|
||||
@@ -66,8 +66,8 @@ describe('apptask', function () {
|
||||
});
|
||||
|
||||
it('barfs on incompatible manifest', function (done) {
|
||||
var badApp = _.extend({ }, APP);
|
||||
badApp.manifest = _.extend({ }, APP.manifest);
|
||||
var badApp = _.extend({ }, app);
|
||||
badApp.manifest = _.extend({ }, app.manifest);
|
||||
badApp.manifest.maxBoxVersion = '0.0.0'; // max box version is too small
|
||||
|
||||
apptask._verifyManifest(badApp.manifest, function (error) {
|
||||
@@ -77,7 +77,7 @@ describe('apptask', function () {
|
||||
});
|
||||
|
||||
it('verifies manifest', function (done) {
|
||||
var goodApp = _.extend({ }, APP);
|
||||
var goodApp = _.extend({ }, app);
|
||||
|
||||
apptask._verifyManifest(goodApp.manifest, function (error) {
|
||||
expect(error).to.be(null);
|
||||
|
||||
Reference in New Issue
Block a user