Replace sleep node module with execSync(sleep)

This commit is contained in:
Johannes Zellner 2016-06-30 16:18:10 +02:00
parent 8102ee1aad
commit 0ad8e9f526
9 changed files with 13 additions and 12 deletions

View File

@ -3,7 +3,7 @@
var common = require('./common.js'), var common = require('./common.js'),
debug = require('debug')('e2e:appstore'), debug = require('debug')('e2e:appstore'),
request = require('superagent-sync'), request = require('superagent-sync'),
sleep = require('sleep').sleep, sleep = require('./shell.js').sleep,
stripe = require('stripe'); stripe = require('stripe');
exports = module.exports = AppStore; exports = module.exports = AppStore;

View File

@ -12,7 +12,7 @@ var assert = require('assert'),
once = require('once'), once = require('once'),
request = require('superagent-sync'), request = require('superagent-sync'),
smtpTransport = require('nodemailer-smtp-transport'), smtpTransport = require('nodemailer-smtp-transport'),
sleep = require('sleep').sleep, sleep = require('./shell.js').sleep,
tls = require('tls'), tls = require('tls'),
url = require('url'), url = require('url'),
util = require('util'); util = require('util');

View File

@ -30,7 +30,6 @@
"safetydance": "0.0.17", "safetydance": "0.0.17",
"semver": "^4.3.6", "semver": "^4.3.6",
"should": "^6.0.3", "should": "^6.0.3",
"sleep": "^3.0.0",
"stripe": "^3.5.0", "stripe": "^3.5.0",
"superagent": "^1.2.0", "superagent": "^1.2.0",
"superagent-sync": "^0.2.0", "superagent-sync": "^0.2.0",

View File

@ -1,6 +1,7 @@
'use strict'; 'use strict';
exports = module.exports = { exports = module.exports = {
sleep: sleep,
sudo: sudo, sudo: sudo,
exec: exec, exec: exec,
system: system system: system
@ -14,6 +15,10 @@ var assert = require('assert'),
var SUDO = '/usr/bin/sudo'; var SUDO = '/usr/bin/sudo';
function sleep(timeout) {
child_process.execSync('sleep ' + timeout);
}
function exec(tag, file, args, options, callback) { function exec(tag, file, args, options, callback) {
assert.strictEqual(typeof tag, 'string'); assert.strictEqual(typeof tag, 'string');
assert.strictEqual(typeof file, 'string'); assert.strictEqual(typeof file, 'string');

View File

@ -14,7 +14,7 @@ var AppStore = require('../appstore.js'),
mailer = require('../mailer.js'), mailer = require('../mailer.js'),
request = require('superagent-sync'), request = require('superagent-sync'),
semver = require('semver'), semver = require('semver'),
sleep = require('sleep').sleep; sleep = require('../shell.js').sleep;
require('colors'); require('colors');

View File

@ -12,7 +12,7 @@ var AppStore = require('../appstore.js'),
dnsSync = require('dns-sync'), dnsSync = require('dns-sync'),
ImapProbe = require('../imap-probe.js'), ImapProbe = require('../imap-probe.js'),
mailer = require('../mailer.js'), mailer = require('../mailer.js'),
sleep = require('sleep').sleep, sleep = require('../shell.js').sleep,
_ = require('underscore'); _ = require('underscore');
require('colors'); require('colors');
@ -33,7 +33,7 @@ describe('Cloudron backup testing', function () {
user: process.env.IMAP_USERNAME, user: process.env.IMAP_USERNAME,
password: process.env.IMAP_PASSWORD, password: process.env.IMAP_PASSWORD,
host: process.env.IMAP_HOST, host: process.env.IMAP_HOST,
port: 993, // imap port port: 993, // imap port
tls: true, tls: true,
readOnly: true readOnly: true
}); });

View File

@ -6,12 +6,10 @@
var AppStore = require('../appstore.js'), var AppStore = require('../appstore.js'),
assert = require('assert'), assert = require('assert'),
async = require('async'),
Cloudron = require('../cloudron.js'), Cloudron = require('../cloudron.js'),
common = require('../common.js'), common = require('../common.js'),
dns = require('dns'),
request = require('superagent-sync'), request = require('superagent-sync'),
sleep = require('sleep').sleep; sleep = require('../shell.js').sleep;
require('colors'); require('colors');
@ -25,7 +23,7 @@ describe('Appstore button', function () {
var owner = common.getOwner(); var owner = common.getOwner();
var admin = common.getAdmin(); var admin = common.getAdmin();
var cloudron, appId, box; var cloudron, box;
it('can login to the store', function () { it('can login to the store', function () {
var accessToken = appStore.getAccessToken(owner); var accessToken = appStore.getAccessToken(owner);

View File

@ -13,7 +13,7 @@ var AppStore = require('../appstore.js'),
common = require('../common.js'), common = require('../common.js'),
request = require('superagent-sync'), request = require('superagent-sync'),
semver = require('semver'), semver = require('semver'),
sleep = require('sleep').sleep; sleep = require('../shell.js').sleep;
require('colors'); require('colors');

View File

@ -8,7 +8,6 @@
var AppStore = require('../appstore.js'), var AppStore = require('../appstore.js'),
assert = require('assert'), assert = require('assert'),
async = require('async'),
AWS = require('aws-sdk'), AWS = require('aws-sdk'),
child_process = require('child_process'), child_process = require('child_process'),
Cloudron = require('../cloudron.js'), Cloudron = require('../cloudron.js'),