now has --notest option

This commit is contained in:
Philipp Kunz 2016-06-16 03:02:33 +02:00
parent 12199a668e
commit 1f50f54fe9
9 changed files with 42 additions and 23 deletions

6
dist/index.js vendored
View File

@ -9,15 +9,15 @@ var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths"); var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain"); var npmts_promisechain_1 = require("./npmts.promisechain");
early.stop() early.stop()
.done(function () { .then(function () {
var npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot); var npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
var npmtsCli = new plugins.smartcli.Smartcli(); var npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask() npmtsCli.standardTask()
.then(function () { .then(function (argvArg) {
plugins.beautylog.figletSync("NPMTS"); plugins.beautylog.figletSync("NPMTS");
plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version); plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version);
try { try {
npmts_promisechain_1.promisechain(); npmts_promisechain_1.promisechain(argvArg);
} }
catch (err) { catch (err) {
console.log(err); console.log(err);

View File

@ -2,10 +2,13 @@
require("typings-global"); require("typings-global");
var plugins = require("./npmts.plugins"); var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths"); var paths = require("./npmts.paths");
exports.run = function () { exports.run = function (argvArg) {
var done = plugins.Q.defer(); var done = plugins.Q.defer();
var config = {}; var config = {};
var configPath = plugins.path.join(paths.cwd, "npmts.json"); var configPath = plugins.path.join(paths.cwd, "npmts.json");
if (argvArg.notest) {
config.notest = true;
}
if (plugins.smartfile.checks.fileExistsSync(configPath)) { if (plugins.smartfile.checks.fileExistsSync(configPath)) {
plugins.beautylog.info("npmts.json".blue + " config file found!"); plugins.beautylog.info("npmts.json".blue + " config file found!");
config = plugins.smartfile.local.toObjectSync(configPath); config = plugins.smartfile.local.toObjectSync(configPath);

View File

@ -11,10 +11,10 @@ var NpmtsJsdoc = require("./npmts.jsdoc");
var NpmtsOptions = require("./npmts.options"); var NpmtsOptions = require("./npmts.options");
var NpmtsPublish = require("./npmts.publish"); var NpmtsPublish = require("./npmts.publish");
var NpmtsTests = require("./npmts.tests"); var NpmtsTests = require("./npmts.tests");
exports.promisechain = function () { exports.promisechain = function (argvArg) {
var done = plugins.Q.defer(); var done = plugins.Q.defer();
exports.npmtsOra.start(); exports.npmtsOra.start();
NpmtsConfigFile.run() NpmtsConfigFile.run(argvArg)
.then(NpmtsOptions.run) .then(NpmtsOptions.run)
.then(NpmtsClean.run) .then(NpmtsClean.run)
.then(NpmtsInstall.run) .then(NpmtsInstall.run)

9
dist/npmts.tests.js vendored
View File

@ -56,6 +56,7 @@ var coverage = function (configArg) {
exports.run = function (configArg) { exports.run = function (configArg) {
var done = plugins.Q.defer(); var done = plugins.Q.defer();
var config = configArg; var config = configArg;
if (!config.notest) {
npmts_promisechain_1.npmtsOra.text("now starting tests"); npmts_promisechain_1.npmtsOra.text("now starting tests");
plugins.beautylog.log("-------------------------------------------------------\n" + plugins.beautylog.log("-------------------------------------------------------\n" +
"*************************** TESTS: ***************************\n" + "*************************** TESTS: ***************************\n" +
@ -63,6 +64,12 @@ exports.run = function (configArg) {
istanbul(config) istanbul(config)
.then(mocha) .then(mocha)
.then(coverage) .then(coverage)
.then(done.resolve); .then(function () {
done.resolve(config);
});
}
else {
done.resolve(config);
}
return done.promise; return done.promise;
}; };

View File

@ -27,7 +27,7 @@
}, },
"homepage": "https://gitlab.com/pushrocks/npmts#readme", "homepage": "https://gitlab.com/pushrocks/npmts#readme",
"dependencies": { "dependencies": {
"beautylog": "5.0.8", "beautylog": "5.0.11",
"early": "^2.0.13", "early": "^2.0.13",
"fs-extra": "^0.30.0", "fs-extra": "^0.30.0",
"gulp": "3.9.1", "gulp": "3.9.1",
@ -47,7 +47,7 @@
"q": "^1.4.1", "q": "^1.4.1",
"shelljs": "^0.7.0", "shelljs": "^0.7.0",
"smartci": "0.0.1", "smartci": "0.0.1",
"smartcli": "1.0.1", "smartcli": "1.0.2",
"smartcov": "0.0.6", "smartcov": "0.0.6",
"smartenv": "1.2.5", "smartenv": "1.2.5",
"smartfile": "3.0.10", "smartfile": "3.0.10",

View File

@ -9,16 +9,16 @@ import * as plugins from "./npmts.plugins"
import * as paths from "./npmts.paths"; import * as paths from "./npmts.paths";
import {promisechain} from "./npmts.promisechain"; import {promisechain} from "./npmts.promisechain";
early.stop() early.stop()
.done(() => { .then(() => {
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot); let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
let npmtsCli = new plugins.smartcli.Smartcli(); let npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask() npmtsCli.standardTask()
.then(() => { .then((argvArg) => {
plugins.beautylog.figletSync("NPMTS"); plugins.beautylog.figletSync("NPMTS");
plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version); plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version);
try { try {
promisechain(); promisechain(argvArg);
} }
catch(err){ catch(err){
console.log(err); console.log(err);

View File

@ -1,10 +1,13 @@
import "typings-global"; import "typings-global";
import plugins = require("./npmts.plugins"); import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths"); import paths = require("./npmts.paths");
export var run = function(){ export var run = function(argvArg){
var done = plugins.Q.defer(); var done = plugins.Q.defer();
var config:any = {}; var config:any = {};
var configPath = plugins.path.join(paths.cwd,"npmts.json"); var configPath = plugins.path.join(paths.cwd,"npmts.json");
if(argvArg.notest){
config.notest = true;
}
if(plugins.smartfile.checks.fileExistsSync(configPath)){ if(plugins.smartfile.checks.fileExistsSync(configPath)){
plugins.beautylog.info("npmts.json".blue + " config file found!"); plugins.beautylog.info("npmts.json".blue + " config file found!");
config = plugins.smartfile.local.toObjectSync(configPath); config = plugins.smartfile.local.toObjectSync(configPath);

View File

@ -13,10 +13,10 @@ import NpmtsOptions = require("./npmts.options");
import NpmtsPublish = require("./npmts.publish"); import NpmtsPublish = require("./npmts.publish");
import NpmtsTests = require("./npmts.tests"); import NpmtsTests = require("./npmts.tests");
export let promisechain = function(){ export let promisechain = function(argvArg){
let done = plugins.Q.defer(); let done = plugins.Q.defer();
npmtsOra.start(); npmtsOra.start();
NpmtsConfigFile.run() NpmtsConfigFile.run(argvArg)
.then(NpmtsOptions.run) .then(NpmtsOptions.run)
.then(NpmtsClean.run) .then(NpmtsClean.run)
.then(NpmtsInstall.run) .then(NpmtsInstall.run)

View File

@ -62,6 +62,7 @@ let coverage = function(configArg){
export let run = function(configArg) { export let run = function(configArg) {
let done = plugins.Q.defer(); let done = plugins.Q.defer();
let config = configArg; let config = configArg;
if(!config.notest){
npmtsOra.text("now starting tests"); npmtsOra.text("now starting tests");
plugins.beautylog.log( plugins.beautylog.log(
@ -73,6 +74,11 @@ export let run = function(configArg) {
istanbul(config) istanbul(config)
.then(mocha) .then(mocha)
.then(coverage) .then(coverage)
.then(done.resolve); .then(() => {
done.resolve(config);
});
} else {
done.resolve(config);
}
return done.promise; return done.promise;
}; };