This commit is contained in:
Philipp Kunz 2016-06-04 00:10:19 +02:00
parent dfe829541e
commit f1244c33dc

41
dist/npmci.test.js vendored
View File

@ -3,18 +3,39 @@ require("typings-global");
var plugins = require("./npmci.plugins"); var plugins = require("./npmci.plugins");
var npmci_bash_1 = require("./npmci.bash"); var npmci_bash_1 = require("./npmci.bash");
var npmci_install_1 = require("./npmci.install"); var npmci_install_1 = require("./npmci.install");
var env = require("./npmci.env");
exports.test = function (versionArg) { exports.test = function (versionArg) {
var done = plugins.q.defer(); var done = plugins.q.defer();
npmci_install_1.install(versionArg) if (versionArg == "docker") {
.then(function () { testDocker()
plugins.beautylog.info("now installing dependencies:"); .then(function () {
npmci_bash_1.bash("npm install"); done.resolve();
plugins.beautylog.info("now starting tests:"); });
npmci_bash_1.bash("npm test"); }
plugins.beautylog.success("test finished"); else {
done.resolve(); npmci_install_1.install(versionArg)
}); .then(npmDependencies)
.then(function () {
plugins.beautylog.info("now starting tests:");
npmci_bash_1.bash("npm test");
plugins.beautylog.success("test finished");
done.resolve();
});
}
return done.promise;
};
var npmDependencies = function () {
var done = plugins.q.defer();
plugins.beautylog.info("now installing dependencies:");
npmci_bash_1.bash("npm install");
done.resolve();
return done.promise;
};
var testDocker = function () {
var done = plugins.q.defer();
plugins.shelljs.exec("docker run --name " + env.repo.repo + " " + env.dockerTag());
done.resolve();
return done.promise; return done.promise;
}; };
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUNsQyw4QkFBc0IsaUJBQWlCLENBQUMsQ0FBQTtBQUc3QixZQUFJLEdBQUcsVUFBQyxVQUFVO0lB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