npmci/dist/npmci.test.js

47 lines
3.1 KiB
JavaScript
Raw Normal View History

2016-05-30 00:29:30 +00:00
"use strict";
require("typings-global");
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-06-03 22:10:19 +00:00
if (versionArg == "docker") {
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-06-03 22:10:19 +00:00
plugins.beautylog.info("now installing dependencies:");
npmci_bash_1.bash("npm install");
done.resolve();
return done.promise;
};
2016-07-18 14:56:53 +00:00
let npmTest = () => {
let done = plugins.q.defer();
2016-06-07 02:31:25 +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-09-20 10:43:37 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDBCQUF3QjtBQUN4Q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