From 1f50f54fe9e5f969ba3960c94c418219a79244dd Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Thu, 16 Jun 2016 03:02:33 +0200 Subject: [PATCH] now has --notest option --- dist/index.js | 6 +++--- dist/npmts.configfile.js | 5 ++++- dist/npmts.promisechain.js | 4 ++-- dist/npmts.tests.js | 23 +++++++++++++++-------- package.json | 4 ++-- ts/index.ts | 6 +++--- ts/npmts.configfile.ts | 5 ++++- ts/npmts.promisechain.ts | 4 ++-- ts/npmts.tests.ts | 8 +++++++- 9 files changed, 42 insertions(+), 23 deletions(-) diff --git a/dist/index.js b/dist/index.js index ef55536..c23259d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -9,15 +9,15 @@ var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); var npmts_promisechain_1 = require("./npmts.promisechain"); early.stop() - .done(function () { + .then(function () { var npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot); var npmtsCli = new plugins.smartcli.Smartcli(); npmtsCli.standardTask() - .then(function () { + .then(function (argvArg) { plugins.beautylog.figletSync("NPMTS"); plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version); try { - npmts_promisechain_1.promisechain(); + npmts_promisechain_1.promisechain(argvArg); } catch (err) { console.log(err); diff --git a/dist/npmts.configfile.js b/dist/npmts.configfile.js index d3e7675..81eca2d 100644 --- a/dist/npmts.configfile.js +++ b/dist/npmts.configfile.js @@ -2,10 +2,13 @@ require("typings-global"); var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); -exports.run = function () { +exports.run = function (argvArg) { var done = plugins.Q.defer(); var config = {}; var configPath = plugins.path.join(paths.cwd, "npmts.json"); + if (argvArg.notest) { + config.notest = true; + } if (plugins.smartfile.checks.fileExistsSync(configPath)) { plugins.beautylog.info("npmts.json".blue + " config file found!"); config = plugins.smartfile.local.toObjectSync(configPath); diff --git a/dist/npmts.promisechain.js b/dist/npmts.promisechain.js index 086e409..c05e9ec 100644 --- a/dist/npmts.promisechain.js +++ b/dist/npmts.promisechain.js @@ -11,10 +11,10 @@ var NpmtsJsdoc = require("./npmts.jsdoc"); var NpmtsOptions = require("./npmts.options"); var NpmtsPublish = require("./npmts.publish"); var NpmtsTests = require("./npmts.tests"); -exports.promisechain = function () { +exports.promisechain = function (argvArg) { var done = plugins.Q.defer(); exports.npmtsOra.start(); - NpmtsConfigFile.run() + NpmtsConfigFile.run(argvArg) .then(NpmtsOptions.run) .then(NpmtsClean.run) .then(NpmtsInstall.run) diff --git a/dist/npmts.tests.js b/dist/npmts.tests.js index 5433377..afefff3 100644 --- a/dist/npmts.tests.js +++ b/dist/npmts.tests.js @@ -56,13 +56,20 @@ var coverage = function (configArg) { exports.run = function (configArg) { var done = plugins.Q.defer(); var config = configArg; - npmts_promisechain_1.npmtsOra.text("now starting tests"); - plugins.beautylog.log("-------------------------------------------------------\n" + - "*************************** TESTS: ***************************\n" + - "--------------------------------------------------------------"); - istanbul(config) - .then(mocha) - .then(coverage) - .then(done.resolve); + if (!config.notest) { + npmts_promisechain_1.npmtsOra.text("now starting tests"); + plugins.beautylog.log("-------------------------------------------------------\n" + + "*************************** TESTS: ***************************\n" + + "--------------------------------------------------------------"); + istanbul(config) + .then(mocha) + .then(coverage) + .then(function () { + done.resolve(config); + }); + } + else { + done.resolve(config); + } return done.promise; }; diff --git a/package.json b/package.json index 467e2a1..2c31734 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "homepage": "https://gitlab.com/pushrocks/npmts#readme", "dependencies": { - "beautylog": "5.0.8", + "beautylog": "5.0.11", "early": "^2.0.13", "fs-extra": "^0.30.0", "gulp": "3.9.1", @@ -47,7 +47,7 @@ "q": "^1.4.1", "shelljs": "^0.7.0", "smartci": "0.0.1", - "smartcli": "1.0.1", + "smartcli": "1.0.2", "smartcov": "0.0.6", "smartenv": "1.2.5", "smartfile": "3.0.10", diff --git a/ts/index.ts b/ts/index.ts index 0400954..f45e66d 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -9,16 +9,16 @@ import * as plugins from "./npmts.plugins" import * as paths from "./npmts.paths"; import {promisechain} from "./npmts.promisechain"; early.stop() - .done(() => { + .then(() => { let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot); let npmtsCli = new plugins.smartcli.Smartcli(); npmtsCli.standardTask() - .then(() => { + .then((argvArg) => { plugins.beautylog.figletSync("NPMTS"); plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version); try { - promisechain(); + promisechain(argvArg); } catch(err){ console.log(err); diff --git a/ts/npmts.configfile.ts b/ts/npmts.configfile.ts index 9fc5bd4..f9be231 100644 --- a/ts/npmts.configfile.ts +++ b/ts/npmts.configfile.ts @@ -1,10 +1,13 @@ import "typings-global"; import plugins = require("./npmts.plugins"); import paths = require("./npmts.paths"); -export var run = function(){ +export var run = function(argvArg){ var done = plugins.Q.defer(); var config:any = {}; var configPath = plugins.path.join(paths.cwd,"npmts.json"); + if(argvArg.notest){ + config.notest = true; + } if(plugins.smartfile.checks.fileExistsSync(configPath)){ plugins.beautylog.info("npmts.json".blue + " config file found!"); config = plugins.smartfile.local.toObjectSync(configPath); diff --git a/ts/npmts.promisechain.ts b/ts/npmts.promisechain.ts index 8384c0b..6b863ad 100644 --- a/ts/npmts.promisechain.ts +++ b/ts/npmts.promisechain.ts @@ -13,10 +13,10 @@ import NpmtsOptions = require("./npmts.options"); import NpmtsPublish = require("./npmts.publish"); import NpmtsTests = require("./npmts.tests"); -export let promisechain = function(){ +export let promisechain = function(argvArg){ let done = plugins.Q.defer(); npmtsOra.start(); - NpmtsConfigFile.run() + NpmtsConfigFile.run(argvArg) .then(NpmtsOptions.run) .then(NpmtsClean.run) .then(NpmtsInstall.run) diff --git a/ts/npmts.tests.ts b/ts/npmts.tests.ts index d2ee360..fe05f3d 100644 --- a/ts/npmts.tests.ts +++ b/ts/npmts.tests.ts @@ -62,6 +62,7 @@ let coverage = function(configArg){ export let run = function(configArg) { let done = plugins.Q.defer(); let config = configArg; + if(!config.notest){ npmtsOra.text("now starting tests"); plugins.beautylog.log( @@ -73,6 +74,11 @@ export let run = function(configArg) { istanbul(config) .then(mocha) .then(coverage) - .then(done.resolve); + .then(() => { + done.resolve(config); + }); + } else { + done.resolve(config); + } return done.promise; }; \ No newline at end of file