npmci/dist/npmci.test.js
2016-11-25 00:07:20 +01:00

46 lines
3.1 KiB
JavaScript

"use strict";
const plugins = require("./npmci.plugins");
const npmci_bash_1 = require("./npmci.bash");
const npmci_install_1 = require("./npmci.install");
const NpmciBuildDocker = require("./npmci.build.docker");
exports.test = (versionArg) => {
let done = plugins.q.defer();
if (versionArg === 'docker') {
testDocker()
.then(() => {
done.resolve();
});
}
else {
npmci_install_1.install(versionArg)
.then(npmDependencies)
.then(npmTest)
.then(() => {
done.resolve();
});
}
return done.promise;
};
let npmDependencies = function () {
let done = plugins.q.defer();
plugins.beautylog.info('now installing dependencies:');
npmci_bash_1.bash('npm install');
done.resolve();
return done.promise;
};
let npmTest = () => {
let done = plugins.q.defer();
plugins.beautylog.info('now starting tests:');
npmci_bash_1.bash('npm test');
done.resolve();
return done.promise;
};
let testDocker = function () {
let done = plugins.q.defer();
NpmciBuildDocker.readDockerfiles()
.then(NpmciBuildDocker.pullDockerfileImages)
.then(NpmciBuildDocker.testDockerfiles)
.then(done.resolve);
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDJDQUEwQztBQUMxQyw2Q0FBaUM7QUFDakMsbURBQXVDO0FBRXZDLHlEQUF3RDtBQUU3QyxRQUFBLElBQUksR0FBRyxDQUFDLFVBQVU7SUFDekIsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQTtJQUM1QixFQUFFLENBQUMsQ0FBQyxVQUFVLEtBQUssUUFBUSxDQUFDLENBQUMsQ0FBQztRQUMxQixVQUFVLEVBQUU7YUFDUCxJQUFJLENBQUM7WUFDRixJQUFJLENBQUMsT0FBTyxFQUFFLENBQUE7UUFDb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