add coveralls config option

This commit is contained in:
Philipp Kunz 2016-02-09 05:46:55 +01:00
parent 13c9c96cc6
commit 3f9194f344
8 changed files with 18 additions and 10 deletions

2
index.d.ts vendored
View File

@ -34,7 +34,7 @@ declare module NpmtsCompile {
var run: (configArg: any) => any;
}
declare module NpmtsTests {
var run: () => any;
var run: (configArg: any) => any;
}
declare module NpmtsPromisechain {
var init: () => any;

View File

@ -77,6 +77,9 @@ var NpmtsOptions;
NpmtsOptions.run = function (configArg) {
var done = plugins.q.defer();
var config = configArg;
if (typeof config.coveralls === "undefined") {
config.coveralls = true;
}
if (config.mode == "default") {
config.typings = [
"./ts/"
@ -190,8 +193,9 @@ var NpmtsCompile;
/// <reference path="./index.ts" />
var NpmtsTests;
(function (NpmtsTests) {
NpmtsTests.run = function () {
NpmtsTests.run = function (configArg) {
var done = plugins.q.defer();
var config = configArg;
plugins.gulp.task('istanbul', function () {
return plugins.gulp.src([plugins.path.join(paths.cwd, "index.js")])
.pipe(plugins.g.istanbul())
@ -205,7 +209,7 @@ var NpmtsTests;
});
plugins.gulp.task("coveralls", function () {
return plugins.gulp.src('coverage/**/lcov.info')
.pipe(plugins.g.if(process.env.TRAVIS, plugins.g.coveralls()));
.pipe(plugins.g.if((process.env.TRAVIS && config.coveralls), plugins.g.coveralls()));
});
plugins.gulp.task("test", function () {
plugins.g.sequence("istanbul", "mocha", "coveralls", function () {

View File

@ -77,7 +77,7 @@
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 05:39:17 GMT+0100 (CET)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 05:46:38 GMT+0100 (CET)
</div>
</div>
<script src="../prettify.js"></script>

View File

@ -76,7 +76,7 @@ module.exports = testplugin;
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 05:39:17 GMT+0100 (CET)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 05:46:38 GMT+0100 (CET)
</div>
</div>
<script src="../prettify.js"></script>

View File

@ -77,7 +77,7 @@
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 05:39:17 GMT+0100 (CET)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 05:46:38 GMT+0100 (CET)
</div>
</div>
<script src="prettify.js"></script>

View File

@ -8,5 +8,6 @@
"./subts1/",
"./subts2/",
"./customdir"
]
],
"coveralls":"false"
}

View File

@ -3,6 +3,9 @@ module NpmtsOptions {
export var run = function(configArg){
var done = plugins.q.defer();
var config = configArg;
if (typeof config.coveralls === "undefined"){
config.coveralls = true;
}
if (config.mode == "default"){
config.typings = [
"./ts/"

View File

@ -1,8 +1,8 @@
/// <reference path="./index.ts" />
module NpmtsTests {
export var run = function() {
export var run = function(configArg) {
var done = plugins.q.defer();
var config = configArg;
plugins.gulp.task('istanbul', function () {
return plugins.gulp.src([plugins.path.join(paths.cwd,"index.js")])
// Covering files
@ -23,7 +23,7 @@ module NpmtsTests {
plugins.gulp.task("coveralls",function(){
return plugins.gulp.src('coverage/**/lcov.info')
.pipe(plugins.g.if(
process.env.TRAVIS,
(process.env.TRAVIS && config.coveralls),
plugins.g.coveralls()
));
});