Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
2a5583946c | |||
80e36a34ee | |||
1f90f4abff | |||
3c7f5f1e2d | |||
8104609306 | |||
a3077f7800 | |||
c947121243 | |||
4b3f0649fa | |||
523c62530f | |||
aa57617fc7 | |||
ef89a33dfc | |||
474a730a09 | |||
e3b029c240 | |||
290824190d | |||
923d78caab | |||
6587b74a23 | |||
aa0a35f258 | |||
09b8809ede | |||
e25566490b | |||
3ed7473066 |
37
README.md
37
README.md
@ -36,29 +36,28 @@ Then add it to your package.json's script section to trigger a build:
|
|||||||
|
|
||||||
### Default task execution order
|
### Default task execution order
|
||||||
|
|
||||||
1. Check config in ./npmts.json
|
1. Check config in ./npmextra.json (Check out [npmextra](https://www.npmjs.com/package/npmextra))
|
||||||
1. Clean up from any previous builds (old js files)
|
1. Clean up from any previous builds (old js files)
|
||||||
1. Install typings
|
1. Transpile TypeScript with **inline sourcemaps** and **declaration files** to ES6
|
||||||
1. Transpile TypeScript with **inline sourcemaps** and **declaration files**
|
1. Create TypeDoc Documentation from TypeScript files
|
||||||
1. Create EsDoc Documentation
|
1. Instrumentalize transpiled ES6 JavaScript with istanbul and run tests with Mocha
|
||||||
1. Instrumentalize created JavaScript files with istanbul
|
|
||||||
1. Run Tests
|
|
||||||
1. Create Coverage report
|
|
||||||
|
|
||||||
#### npmts.json
|
#### npmtsextra.json
|
||||||
the npmts.json is the main config file. You can use it to customize the behaviour of NPMTS.
|
the npmts section in npmtsextra.json can be used to configure npmts.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mode":"default",
|
"npmts":{
|
||||||
"ts":{
|
"mode":"default",
|
||||||
"./customdir/*.ts":"./"
|
"ts":{
|
||||||
},
|
"./customdir/*.ts":"./"
|
||||||
"tsOptions":{
|
},
|
||||||
"declaration":false,
|
"tsOptions":{
|
||||||
"target":"ES6"
|
"declaration":false,
|
||||||
},
|
"target":"ES6"
|
||||||
"cli":true
|
},
|
||||||
|
"cli":true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -111,7 +110,7 @@ thanks to autogenerated source maps.
|
|||||||
## Tips and tricks:
|
## Tips and tricks:
|
||||||
|
|
||||||
* Use [npmts-g](https://www.npmjs.com/package/npmts-g) to use globally installed npmts and install npmts locally if no global npmts is available.
|
* Use [npmts-g](https://www.npmjs.com/package/npmts-g) to use globally installed npmts and install npmts locally if no global npmts is available.
|
||||||
* Use [npmpage](https://www.npmjs.com/package/npmtspage) to create a webpage from coverage reports and EsDocs for the module
|
* Use [npmpage](https://www.npmjs.com/package/npmtspage) to create a webpage from coverage reports and TypeDoc for the module
|
||||||
* Use [hosttoday/ht-docker-node:npmts](https://hub.docker.com/r/hosttoday/ht-docker-node/) for speedy CI builds
|
* Use [hosttoday/ht-docker-node:npmts](https://hub.docker.com/r/hosttoday/ht-docker-node/) for speedy CI builds
|
||||||
|
|
||||||
## About the authors:
|
## About the authors:
|
||||||
|
1
dist/npmts.cli.d.ts
vendored
1
dist/npmts.cli.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
import "typings-global";
|
|
2
dist/npmts.cli.js
vendored
2
dist/npmts.cli.js
vendored
@ -1,2 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
require("typings-global");
|
|
2
dist/npmts.compile.js
vendored
2
dist/npmts.compile.js
vendored
@ -9,7 +9,7 @@ var compileTs = function (tsFileArrayArg, tsOptionsArg) {
|
|||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
var tsOptionsDefault = {
|
var tsOptionsDefault = {
|
||||||
declaration: true,
|
declaration: true,
|
||||||
target: "ES5",
|
target: "ES6",
|
||||||
module: "commonjs"
|
module: "commonjs"
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
47
dist/npmts.configfile.js
vendored
47
dist/npmts.configfile.js
vendored
@ -2,33 +2,34 @@
|
|||||||
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");
|
||||||
|
var npmts_promisechain_1 = require("./npmts.promisechain");
|
||||||
exports.run = function (argvArg) {
|
exports.run = function (argvArg) {
|
||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
var config = {};
|
npmts_promisechain_1.npmtsOra.text("looking for npmextra.json");
|
||||||
var configPath = plugins.path.join(paths.cwd, "npmts.json");
|
var defaultConfig = {
|
||||||
|
mode: "default",
|
||||||
|
notest: false
|
||||||
|
};
|
||||||
if (argvArg.notest) {
|
if (argvArg.notest) {
|
||||||
config.notest = true;
|
defaultConfig.notest = true;
|
||||||
}
|
|
||||||
if (plugins.smartfile.fs.fileExistsSync(configPath)) {
|
|
||||||
plugins.beautylog.info("npmts.json".blue + " config file found!");
|
|
||||||
config = plugins.lodashObject.assign(config, plugins.smartfile.fs.toObjectSync(configPath));
|
|
||||||
switch (config.mode) {
|
|
||||||
case "default":
|
|
||||||
case "custom":
|
|
||||||
plugins.beautylog.ok("mode is " + config.mode.yellow);
|
|
||||||
done.resolve(config);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
plugins.beautylog.log("no config file found: so mode is " + "default".yellow);
|
|
||||||
config.mode = "default";
|
|
||||||
done.resolve(config);
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
var config = plugins.npmextra.dataFor({
|
||||||
|
toolName: "npmts",
|
||||||
|
defaultSettings: defaultConfig,
|
||||||
|
cwd: paths.cwd
|
||||||
|
});
|
||||||
|
switch (config.mode) {
|
||||||
|
case "default":
|
||||||
|
case "custom":
|
||||||
|
plugins.beautylog.ok("mode is " + config.mode.yellow);
|
||||||
|
done.resolve(config);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
done.resolve(config);
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
||||||
|
6
dist/npmts.plugins.d.ts
vendored
6
dist/npmts.plugins.d.ts
vendored
@ -2,15 +2,17 @@ import "typings-global";
|
|||||||
export import beautylog = require("beautylog");
|
export import beautylog = require("beautylog");
|
||||||
export declare let gulp: any;
|
export declare let gulp: any;
|
||||||
export declare let g: {
|
export declare let g: {
|
||||||
gFunction: any;
|
babel: any;
|
||||||
istanbul: any;
|
istanbul: any;
|
||||||
|
gFunction: any;
|
||||||
|
injectModules: any;
|
||||||
mocha: any;
|
mocha: any;
|
||||||
replace: any;
|
replace: any;
|
||||||
sourcemaps: any;
|
sourcemaps: any;
|
||||||
typedoc: any;
|
typedoc: any;
|
||||||
};
|
};
|
||||||
export declare let lodashObject: any;
|
export declare let lodashObject: any;
|
||||||
export declare let merge2: any;
|
export import npmextra = require("npmextra");
|
||||||
export import projectinfo = require("projectinfo");
|
export import projectinfo = require("projectinfo");
|
||||||
export import path = require("path");
|
export import path = require("path");
|
||||||
export import Q = require("q");
|
export import Q = require("q");
|
||||||
|
6
dist/npmts.plugins.js
vendored
6
dist/npmts.plugins.js
vendored
@ -3,15 +3,17 @@ require("typings-global");
|
|||||||
exports.beautylog = require("beautylog");
|
exports.beautylog = require("beautylog");
|
||||||
exports.gulp = require("gulp");
|
exports.gulp = require("gulp");
|
||||||
exports.g = {
|
exports.g = {
|
||||||
gFunction: require("gulp-function"),
|
babel: require("gulp-babel"),
|
||||||
istanbul: require("gulp-istanbul"),
|
istanbul: require("gulp-istanbul"),
|
||||||
|
gFunction: require("gulp-function"),
|
||||||
|
injectModules: require("gulp-inject-modules"),
|
||||||
mocha: require("gulp-mocha"),
|
mocha: require("gulp-mocha"),
|
||||||
replace: require("gulp-replace"),
|
replace: require("gulp-replace"),
|
||||||
sourcemaps: require("gulp-sourcemaps"),
|
sourcemaps: require("gulp-sourcemaps"),
|
||||||
typedoc: require("gulp-typedoc")
|
typedoc: require("gulp-typedoc")
|
||||||
};
|
};
|
||||||
exports.lodashObject = require('lodash/fp/object');
|
exports.lodashObject = require('lodash/fp/object');
|
||||||
exports.merge2 = require("merge2");
|
exports.npmextra = require("npmextra");
|
||||||
exports.projectinfo = require("projectinfo");
|
exports.projectinfo = require("projectinfo");
|
||||||
exports.path = require("path");
|
exports.path = require("path");
|
||||||
exports.Q = require("q");
|
exports.Q = require("q");
|
||||||
|
55
dist/npmts.tests.js
vendored
55
dist/npmts.tests.js
vendored
@ -7,34 +7,38 @@ var npmts_promisechain_1 = require("./npmts.promisechain");
|
|||||||
*
|
*
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
var istanbul = function (configArg) {
|
var mocha = function (configArg) {
|
||||||
npmts_promisechain_1.npmtsOra.text("Instrumentalizing transpiled JS...");
|
npmts_promisechain_1.npmtsOra.text("Instrumentalizing and testing transpiled JS");
|
||||||
|
npmts_promisechain_1.npmtsOra.end(); // end npmtsOra for tests.
|
||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "dist/*.js")])
|
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "dist/*.js")])
|
||||||
.pipe(plugins.g.sourcemaps.init())
|
.pipe(plugins.g.sourcemaps.init())
|
||||||
.pipe(plugins.g.istanbul()) // Covering files
|
.pipe(plugins.g.babel({
|
||||||
|
presets: [
|
||||||
|
require.resolve("babel-preset-es2015")
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
.pipe(plugins.g.istanbul({}))
|
||||||
.pipe(plugins.g.sourcemaps.write())
|
.pipe(plugins.g.sourcemaps.write())
|
||||||
.pipe(plugins.g.istanbul.hookRequire()) // Force `require` to return covered files
|
.pipe(plugins.g.injectModules())
|
||||||
.pipe(plugins.g.gFunction(function () {
|
.on("finish", function () {
|
||||||
plugins.beautylog.ok("JS has been instrumentalized to get test code coverage!");
|
plugins.gulp.src([plugins.path.join(paths.cwd, "test/test.js")])
|
||||||
done.resolve(configArg);
|
.pipe(plugins.g.babel({
|
||||||
}, "atEnd"));
|
presets: [
|
||||||
return done.promise;
|
plugins.path.join(paths.npmtsPackageRoot, "node_modules/babel-preset-es2015/index.js")
|
||||||
};
|
]
|
||||||
/**
|
}))
|
||||||
*
|
.pipe(plugins.g.injectModules())
|
||||||
* @returns {*}
|
.pipe(plugins.g.mocha())
|
||||||
*/
|
.pipe(plugins.g.istanbul.writeReports({
|
||||||
var mocha = function (configArg) {
|
dir: plugins.path.join(paths.cwd, "./coverage"),
|
||||||
var done = plugins.Q.defer();
|
reporters: ['lcovonly', 'json', 'text', 'text-summary']
|
||||||
npmts_promisechain_1.npmtsOra.end(); // end npmtsOra for tests.
|
}))
|
||||||
var stream = plugins.gulp.src(["./test/test.js"])
|
.pipe(plugins.g.gFunction(function () {
|
||||||
.pipe(plugins.g.mocha())
|
plugins.beautylog.ok("Tested!");
|
||||||
.pipe(plugins.g.istanbul.writeReports()) // Creating the reports after tests ran
|
done.resolve(configArg);
|
||||||
.pipe(plugins.g.gFunction(function () {
|
}, "atEnd"));
|
||||||
plugins.beautylog.ok("Tests have passed!");
|
});
|
||||||
done.resolve(configArg);
|
|
||||||
}, "atEnd"));
|
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
||||||
var coverage = function (configArg) {
|
var coverage = function (configArg) {
|
||||||
@ -63,8 +67,7 @@ exports.run = function (configArg) {
|
|||||||
plugins.beautylog.log("-------------------------------------------------------\n" +
|
plugins.beautylog.log("-------------------------------------------------------\n" +
|
||||||
"*************************** TESTS: ***************************\n" +
|
"*************************** TESTS: ***************************\n" +
|
||||||
"--------------------------------------------------------------");
|
"--------------------------------------------------------------");
|
||||||
istanbul(config)
|
mocha(config)
|
||||||
.then(mocha)
|
|
||||||
.then(coverage)
|
.then(coverage)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
done.resolve(config);
|
done.resolve(config);
|
||||||
|
15
package.json
15
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "npmts",
|
"name": "npmts",
|
||||||
"version": "5.3.13",
|
"version": "5.3.23",
|
||||||
"description": "write npm modules with TypeScript",
|
"description": "write npm modules with TypeScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -29,24 +29,25 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/npmts#readme",
|
"homepage": "https://gitlab.com/pushrocks/npmts#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/minimatch": "*",
|
"@types/minimatch": "^2.0.28",
|
||||||
"@types/q": "*",
|
"@types/q": "^0.0.27",
|
||||||
"@types/shelljs": "*",
|
"@types/shelljs": "^0.3.27",
|
||||||
|
"babel-preset-es2015": "^6.9.0",
|
||||||
"beautylog": "5.0.14",
|
"beautylog": "5.0.14",
|
||||||
"early": "^2.0.13",
|
"early": "^2.0.13",
|
||||||
"esdoc": "^0.4.7",
|
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
|
"gulp-babel": "^6.1.2",
|
||||||
"gulp-concat": "^2.6.0",
|
"gulp-concat": "^2.6.0",
|
||||||
"gulp-function": "^1.3.6",
|
"gulp-function": "^1.3.6",
|
||||||
"gulp-if": "^2.0.1",
|
"gulp-if": "^2.0.1",
|
||||||
|
"gulp-inject-modules": "^1.0.0",
|
||||||
"gulp-istanbul": "^1.0.0",
|
"gulp-istanbul": "^1.0.0",
|
||||||
"gulp-jsdoc3": "^0.3.0",
|
|
||||||
"gulp-mocha": "^2.2.0",
|
"gulp-mocha": "^2.2.0",
|
||||||
"gulp-replace": "^0.5.4",
|
"gulp-replace": "^0.5.4",
|
||||||
"gulp-sourcemaps": "^1.6.0",
|
"gulp-sourcemaps": "^1.6.0",
|
||||||
"gulp-typedoc": "^2.0.0",
|
"gulp-typedoc": "^2.0.0",
|
||||||
"lodash": "^4.13.1",
|
"lodash": "^4.13.1",
|
||||||
"merge2": "1.0.2",
|
"npmextra": "^1.0.7",
|
||||||
"projectinfo": "1.0.3",
|
"projectinfo": "1.0.3",
|
||||||
"q": "^1.4.1",
|
"q": "^1.4.1",
|
||||||
"shelljs": "^0.7.0",
|
"shelljs": "^0.7.0",
|
||||||
|
@ -1 +0,0 @@
|
|||||||
import "typings-global";
|
|
@ -10,7 +10,7 @@ let compileTs = (tsFileArrayArg:string[],tsOptionsArg = {}) => {
|
|||||||
|
|
||||||
let tsOptionsDefault = {
|
let tsOptionsDefault = {
|
||||||
declaration: true,
|
declaration: true,
|
||||||
target: "ES5",
|
target: "ES6",
|
||||||
module: "commonjs"
|
module: "commonjs"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,33 +1,32 @@
|
|||||||
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");
|
||||||
|
import {npmtsOra} from "./npmts.promisechain";
|
||||||
export var run = function(argvArg){
|
export var run = function(argvArg){
|
||||||
var done = plugins.Q.defer();
|
let done = plugins.Q.defer();
|
||||||
var config:any = {};
|
npmtsOra.text("looking for npmextra.json");
|
||||||
var configPath = plugins.path.join(paths.cwd,"npmts.json");
|
let defaultConfig = {
|
||||||
if(argvArg.notest){
|
mode: "default",
|
||||||
config.notest = true;
|
notest:false
|
||||||
}
|
|
||||||
if(plugins.smartfile.fs.fileExistsSync(configPath)){
|
|
||||||
plugins.beautylog.info("npmts.json".blue + " config file found!");
|
|
||||||
config = plugins.lodashObject.assign(
|
|
||||||
config,
|
|
||||||
plugins.smartfile.fs.toObjectSync(configPath)
|
|
||||||
);
|
|
||||||
switch (config.mode){
|
|
||||||
case "default":
|
|
||||||
case "custom":
|
|
||||||
plugins.beautylog.ok("mode is " + config.mode.yellow);
|
|
||||||
done.resolve(config);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
|
|
||||||
process.exit(1);
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
plugins.beautylog.log("no config file found: so mode is " + "default".yellow);
|
|
||||||
config.mode = "default";
|
|
||||||
done.resolve(config);
|
|
||||||
};
|
};
|
||||||
|
if(argvArg.notest){
|
||||||
|
defaultConfig.notest = true;
|
||||||
|
};
|
||||||
|
let config = plugins.npmextra.dataFor({
|
||||||
|
toolName:"npmts",
|
||||||
|
defaultSettings:defaultConfig,
|
||||||
|
cwd:paths.cwd
|
||||||
|
});
|
||||||
|
switch (config.mode){
|
||||||
|
case "default":
|
||||||
|
case "custom":
|
||||||
|
plugins.beautylog.ok("mode is " + config.mode.yellow);
|
||||||
|
done.resolve(config);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
|
||||||
|
process.exit(1);
|
||||||
|
};
|
||||||
|
done.resolve(config);
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
@ -2,15 +2,17 @@ import "typings-global";
|
|||||||
export import beautylog = require("beautylog");
|
export import beautylog = require("beautylog");
|
||||||
export let gulp = require("gulp");
|
export let gulp = require("gulp");
|
||||||
export let g = {
|
export let g = {
|
||||||
gFunction: require("gulp-function"),
|
babel: require("gulp-babel"),
|
||||||
istanbul: require("gulp-istanbul"),
|
istanbul: require("gulp-istanbul"),
|
||||||
|
gFunction: require("gulp-function"),
|
||||||
|
injectModules: require("gulp-inject-modules"),
|
||||||
mocha: require("gulp-mocha"),
|
mocha: require("gulp-mocha"),
|
||||||
replace: require("gulp-replace"),
|
replace: require("gulp-replace"),
|
||||||
sourcemaps: require("gulp-sourcemaps"),
|
sourcemaps: require("gulp-sourcemaps"),
|
||||||
typedoc: require("gulp-typedoc")
|
typedoc: require("gulp-typedoc")
|
||||||
};
|
};
|
||||||
export let lodashObject = require('lodash/fp/object');
|
export let lodashObject = require('lodash/fp/object');
|
||||||
export let merge2 = require("merge2");
|
export import npmextra = require("npmextra");
|
||||||
export import projectinfo = require("projectinfo");
|
export import projectinfo = require("projectinfo");
|
||||||
export import path = require("path");
|
export import path = require("path");
|
||||||
export import Q = require("q");
|
export import Q = require("q");
|
||||||
|
@ -7,35 +7,39 @@ import {npmtsOra} from "./npmts.promisechain";
|
|||||||
*
|
*
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
let istanbul = function (configArg) {
|
let mocha = function (configArg) {
|
||||||
npmtsOra.text("Instrumentalizing transpiled JS...");
|
npmtsOra.text("Instrumentalizing and testing transpiled JS");
|
||||||
|
npmtsOra.end(); // end npmtsOra for tests.
|
||||||
let done = plugins.Q.defer();
|
let done = plugins.Q.defer();
|
||||||
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"dist/*.js")])
|
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"dist/*.js")])
|
||||||
.pipe(plugins.g.sourcemaps.init())
|
.pipe(plugins.g.sourcemaps.init())
|
||||||
.pipe(plugins.g.istanbul()) // Covering files
|
.pipe(plugins.g.babel({
|
||||||
|
presets: [
|
||||||
|
require.resolve("babel-preset-es2015")
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
.pipe(plugins.g.istanbul({
|
||||||
|
}))
|
||||||
.pipe(plugins.g.sourcemaps.write())
|
.pipe(plugins.g.sourcemaps.write())
|
||||||
.pipe(plugins.g.istanbul.hookRequire()) // Force `require` to return covered files
|
.pipe(plugins.g.injectModules())
|
||||||
.pipe(plugins.g.gFunction(function(){
|
.on("finish",function(){
|
||||||
plugins.beautylog.ok("JS has been instrumentalized to get test code coverage!");
|
plugins.gulp.src([plugins.path.join(paths.cwd,"test/test.js")])
|
||||||
done.resolve(configArg);
|
.pipe(plugins.g.babel({
|
||||||
},"atEnd"));
|
presets: [
|
||||||
return done.promise;
|
plugins.path.join(paths.npmtsPackageRoot,"node_modules/babel-preset-es2015/index.js")
|
||||||
};
|
]
|
||||||
|
}))
|
||||||
/**
|
.pipe(plugins.g.injectModules())
|
||||||
*
|
.pipe(plugins.g.mocha())
|
||||||
* @returns {*}
|
.pipe(plugins.g.istanbul.writeReports({
|
||||||
*/
|
dir: plugins.path.join(paths.cwd,"./coverage"),
|
||||||
let mocha = function (configArg) {
|
reporters: [ 'lcovonly', 'json', 'text', 'text-summary']
|
||||||
let done = plugins.Q.defer();
|
}))
|
||||||
npmtsOra.end(); // end npmtsOra for tests.
|
.pipe(plugins.g.gFunction(function(){
|
||||||
let stream = plugins.gulp.src(["./test/test.js"])
|
plugins.beautylog.ok("Tested!");
|
||||||
.pipe(plugins.g.mocha())
|
done.resolve(configArg);
|
||||||
.pipe(plugins.g.istanbul.writeReports()) // Creating the reports after tests ran
|
},"atEnd"));
|
||||||
.pipe(plugins.g.gFunction(function(){
|
});
|
||||||
plugins.beautylog.ok("Tests have passed!");
|
|
||||||
done.resolve(configArg);
|
|
||||||
},"atEnd"));
|
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -72,8 +76,7 @@ export let run = function(configArg) {
|
|||||||
"--------------------------------------------------------------"
|
"--------------------------------------------------------------"
|
||||||
);
|
);
|
||||||
|
|
||||||
istanbul(config)
|
mocha(config)
|
||||||
.then(mocha)
|
|
||||||
.then(coverage)
|
.then(coverage)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
done.resolve(config);
|
done.resolve(config);
|
||||||
|
Reference in New Issue
Block a user