44 lines
1.0 KiB
JavaScript
44 lines
1.0 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
/*
|
|
* This test cleans up all t-* cloudrons from previous run.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var AppStore = require('../appstore.js'),
|
|
assert = require('assert'),
|
|
Cloudron = require('../cloudron.js'),
|
|
common = require('../common.js'),
|
|
request = require('superagent-sync'),
|
|
semver = require('semver');
|
|
|
|
require('colors');
|
|
|
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
|
|
|
describe('Cleanup old cloudrons', function () {
|
|
this.timeout(0);
|
|
|
|
var appStore = new AppStore('https://api.staging.cloudron.io');
|
|
|
|
var owner = common.getOwner();
|
|
var cloudrons;
|
|
|
|
it('can login to the store', function () {
|
|
var accessToken = appStore.getAccessToken(owner);
|
|
appStore.setCredentials(owner.password, accessToken);
|
|
});
|
|
|
|
it('can list cloudrons', function () {
|
|
cloudrons = appStore.getCloudrons();
|
|
});
|
|
|
|
it('can delete the cloudrons', function () {
|
|
for (var i = 0; i < cloudrons.length; i++) {
|
|
appStore.deleteCloudron(cloudrons[i]);
|
|
}
|
|
});
|
|
});
|
|
|