cloudron-e2e-test/common.js
Girish Ramakrishnan 670e57d2e8 add missing require
2015-06-20 11:49:12 -07:00

27 lines
671 B
JavaScript

'use strict';
var path = require('path');
exports = module.exports = {
TESTAPP_ID: 'io.cloudron.testapp',
TESTAPP_VERSION : '1.0.2',
cloudronDomain: cloudronDomain,
verifyResponse: verifyResponse
};
function cloudronDomain(filename) {
var r = (Math.random() * 1000).toFixed();
return 't-' + path.basename(filename, '-test.js') + '-' + r + '.smartserver.io';
}
function verifyResponse(res, errorMessage) {
if (res.statusCode < 200 || res.statusCode > 299) {
console.log('Response error statusCode:%s error:%s body:%s', res.statusCode, res.error, res.body);
console.log(errorMessage.red);
process.exit(1);
}
}