27 lines
671 B
JavaScript
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);
|
|
}
|
|
}
|
|
|
|
|