npmci/dist/npmci.test.js

46 lines
3.1 KiB
JavaScript
Raw Permalink Normal View History

2016-05-30 00:29:30 +00:00
"use strict";
2016-07-18 14:56:53 +00:00
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();
2016-11-24 22:21:40 +00:00
if (versionArg === 'docker') {
2016-06-03 22:10:19 +00:00
testDocker()
2016-07-18 14:56:53 +00:00
.then(() => {
2016-06-03 22:10:19 +00:00
done.resolve();
});
}
else {
npmci_install_1.install(versionArg)
.then(npmDependencies)
2016-06-07 02:31:25 +00:00
.then(npmTest)
2016-07-18 14:56:53 +00:00
.then(() => {
2016-06-03 22:10:19 +00:00
done.resolve();
});
}
return done.promise;
};
2016-07-18 14:56:53 +00:00
let npmDependencies = function () {
let done = plugins.q.defer();
2016-11-24 22:21:40 +00:00
plugins.beautylog.info('now installing dependencies:');
npmci_bash_1.bash('npm install');
2016-06-03 22:10:19 +00:00
done.resolve();
return done.promise;
};
2016-07-18 14:56:53 +00:00
let npmTest = () => {
let done = plugins.q.defer();
2016-11-24 22:21:40 +00:00
plugins.beautylog.info('now starting tests:');
npmci_bash_1.bash('npm test');
2016-06-03 22:10:19 +00:00
done.resolve();
2016-05-30 00:29:30 +00:00
return done.promise;
};
2016-07-18 14:56:53 +00:00
let testDocker = function () {
let done = plugins.q.defer();
2016-06-07 02:31:25 +00:00
NpmciBuildDocker.readDockerfiles()
.then(NpmciBuildDocker.pullDockerfileImages)
.then(NpmciBuildDocker.testDockerfiles)
.then(done.resolve);
return done.promise;
};
2016-11-24 23:07:20 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBw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