npmci/dist/npmci.test.js

40 lines
4.2 KiB
JavaScript
Raw Normal View History

2016-05-30 00:29:30 +00:00
"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
2016-05-30 01:40:07 +00:00
var npmci_bash_1 = require("./npmci.bash");
2016-05-30 00:29:30 +00:00
var npmci_install_1 = require("./npmci.install");
exports.test = function (versionArg) {
var done = plugins.q.defer();
2016-06-03 22:10:19 +00:00
if (versionArg == "docker") {
testDocker()
.then(function () {
done.resolve();
});
}
else {
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();
done.resolve();
2016-05-30 00:29:30 +00:00
return done.promise;
};
2016-06-05 14:43:27 +00:00
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUNsQyw4QkFBc0IsaUJBQWlCLENBQUMsQ0FBQTtBQUc3QixZQUFJLEdBQUcsVUFBQyxVQUFVO0lBQ3pCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFBLENBQUMsVUFBVSxJQUFJLFFBQVEsQ0FBQyxDQUFBLENBQUM7UUFDdkIsVUFBVSxFQUFFO2FBQ1AsSUFBSSxDQUFDO1lBQ0YsSUFBSSxDQU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FBQSIsImZpbGUiOiJucG1jaS50ZXN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIjtcclxuaW1wb3J0ICogYXMgcGx1Z2lucyBmcm9tIFwiLi9ucG1jaS5wbHVnaW5zXCI7XHJcbmltcG9ydCB7YmFzaH0gZnJvbSBcIi4vbnBtY2kuYmFzaFwiO1xyXG5pbXBvcnQge2luc3RhbGx9IGZyb20gXCIuL25wbWNpLmluc3RhbGxcIjtcclxuaW1wb3J0ICogYXMgZW52IGZyb20gXCIuL25wbWNpLmVudlwiO1xyXG5cclxuZXhwb3J0IGxldCB0ZXN0ID0gKHZlcnNpb25BcmcpID0+IHtcclxuICAgIGxldCBkb25lID0gcGx1Z2lucy5xLmRlZmVyKCk7XHJcbiAgICBpZih2ZXJzaW9uQXJnID09IFwiZG9ja2VyXCIpe1xyXG4gICAgICAgIHRlc3REb2NrZXIoKVxyXG4gICAgICAgICAgICAudGhlbigoKT0+e1xyXG4gICAgICAgICAgICAgICAgZG9uZS5yZXNvbHZlKCk7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgfSBlbHNlIHtcclxuICAgICAgICBpbnN0YWxsKHZlcnNpb25BcmcpXHJcbiAgICAgICAgICAgIC50aGVuKG5wbURlcGVuZGVuY2llcylcclxuICAgICAgICAgICAgLnRoZW4oKCk9PntcclxuICAgICAgICAgICAgICAgIHBsdWdpbnMuYmVhdXR5bG9nLmluZm8oXCJub3cgc3RhcnRpbmcgdGVzdHM6XCIpO1xyXG4gICAgICAgICAgICAgICAgYmFzaChcIm5wbSB0ZXN0XCIpO1xyXG4gICAgICAgICAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cuc3VjY2VzcyhcInRlc3QgZmluaXNoZWRcIik7XHJcbiAgICAgICAgICAgICAgICBkb25lLnJlc29sdmUoKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gZG9uZS5wcm9taXNlO1xyXG59XHJcblxyXG5sZXQgbnBtRGVwZW5kZW5jaWVzID0gZnVuY3Rpb24oKXtcclxuICAgIGxldCBkb25lID0gcGx1Z2lucy5xLmRlZmVyKCk7XHJcbiAgICBwbHVnaW5zLmJlYXV0eWxvZy5pbmZvKFwibm93IGluc3RhbGxpbmcgZGVwZW5kZW5jaWVzOlwiKTtcclxuICAgIGJhc2goXCJucG0gaW5zdGFsbFwiKTtcclxuICAgIGRvbmUucmVzb2x2ZSgpO1xyXG4gICAgcmV0dXJuIGRvbmUucHJvbWlzZTtcclxufVxyXG5cclxubGV0IHRlc3REb2NrZXIgPSBmdW5jdGlvbigpe1xyXG4gICAgbGV0IGRvbmUgPSBwbHVnaW5zLnEuZGVmZXIoKTtcclxuICAgIFxyXG4gICAgZG9uZS5yZXNvbHZlKCk7XHJcbiAgICByZXR1cm4gZG9uZS5wcm9taXNlO1xyXG59XHJcblxyXG4iXX0=