npmci/dist/npmci.test.js

38 lines
2.9 KiB
JavaScript
Raw Normal View History

2016-05-30 00:29:30 +00:00
"use strict";
2017-03-11 00:10:37 +00:00
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
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");
2017-03-11 00:10:37 +00:00
exports.test = (versionArg) => __awaiter(this, void 0, void 0, function* () {
2016-11-24 22:21:40 +00:00
if (versionArg === 'docker') {
2017-03-11 00:10:37 +00:00
yield testDocker();
2016-06-03 22:10:19 +00:00
}
else {
2017-03-11 00:10:37 +00:00
yield npmci_install_1.install(versionArg)
2016-06-03 22:10:19 +00:00
.then(npmDependencies)
2017-03-11 00:10:37 +00:00
.then(npmTest);
2016-06-03 22:10:19 +00:00
}
2017-03-11 00:10:37 +00:00
});
let npmDependencies = () => __awaiter(this, void 0, void 0, function* () {
2016-11-24 22:21:40 +00:00
plugins.beautylog.info('now installing dependencies:');
2017-03-11 00:10:37 +00:00
yield npmci_bash_1.bash('npm install');
});
let npmTest = () => __awaiter(this, void 0, void 0, function* () {
2016-11-24 22:21:40 +00:00
plugins.beautylog.info('now starting tests:');
2017-03-11 00:10:37 +00:00
yield npmci_bash_1.bash('npm test');
});
let testDocker = () => __awaiter(this, void 0, void 0, function* () {
return yield NpmciBuildDocker.readDockerfiles()
2016-06-07 02:31:25 +00:00
.then(NpmciBuildDocker.pullDockerfileImages)
2017-03-11 00:10:37 +00:00
.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