Compare commits

...

5 Commits

Author SHA1 Message Date
1ada5dd5a9 2.2.1 2016-02-09 17:42:43 +01:00
a41bfd442c fix coveralls initial value 2016-02-09 17:42:31 +01:00
2917b10ffb 2.2.0 2016-02-09 17:26:37 +01:00
bfc5bbbbb7 fix coverage path 2016-02-09 17:26:25 +01:00
cf507a4a17 add coverage badge 2016-02-09 17:19:27 +01:00
10 changed files with 25 additions and 21 deletions

View File

@ -1,6 +1,9 @@
# npmts
Write npm modules with TypeScript without hassle.
## Status
[![Coverage Status](https://coveralls.io/repos/github/pushrocks/npmts/badge.svg?branch=master)](https://coveralls.io/github/pushrocks/npmts?branch=master)
## How to use npmts
### Install

2
index.d.ts vendored
View File

@ -6,7 +6,6 @@ declare module NpmtsPlugins {
gulp: any;
g: {
coveralls: any;
if: any;
insert: any;
istanbul: any;
mocha: any;
@ -44,7 +43,6 @@ declare var plugins: {
gulp: any;
g: {
coveralls: any;
if: any;
insert: any;
istanbul: any;
mocha: any;

View File

@ -10,7 +10,6 @@ var NpmtsPlugins;
gulp: require("gulp"),
g: {
coveralls: require("gulp-coveralls"),
if: require("gulp-if"),
insert: require("gulp-insert"),
istanbul: require("gulp-istanbul"),
mocha: require("gulp-mocha"),
@ -209,15 +208,20 @@ var NpmtsTests;
return stream;
};
var coveralls = function () {
var stream = plugins.gulp.src("./coverage/**/lcov.info")
.pipe(plugins.g.if((process.env.TRAVIS && config.coveralls), plugins.g.coveralls()));
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")])
.pipe(plugins.g.coveralls());
return stream;
};
istanbul().on("finish", function () {
mocha().on("finish", function () {
coveralls().on("finish", function () {
if (process.env.TRAVIS && config.coveralls) {
coveralls().on("finish", function () {
done.resolve(config);
});
}
else {
done.resolve(config);
});
}
});
});
return done.promise;

View File

@ -1,6 +1,6 @@
{
"name": "npmts",
"version": "2.1.10",
"version": "2.2.1",
"description": "write npm modules with TypeScript",
"main": "index.js",
"typings": "./index.d.ts",
@ -30,7 +30,6 @@
"fs-extra": "^0.26.5",
"gulp": "3.9.0",
"gulp-coveralls": "^0.1.4",
"gulp-if": "^2.0.0",
"gulp-insert": "0.5.0",
"gulp-istanbul": "^0.10.3",
"gulp-mocha": "^2.2.0",

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 17:01:13 GMT+0100 (CET)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 17:25:54 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 17:01:13 GMT+0100 (CET)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 17:25:54 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 17:01:13 GMT+0100 (CET)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 17:25:54 GMT+0100 (CET)
</div>
</div>
<script src="prettify.js"></script>

View File

@ -4,7 +4,7 @@ module NpmtsOptions {
var done = plugins.q.defer();
var config = configArg;
if (typeof config.coveralls === "undefined"){
config.coveralls = true;
config.coveralls = false;
}
if (config.mode == "default"){
config.typings = [

View File

@ -7,7 +7,6 @@ module NpmtsPlugins {
gulp: require("gulp"),
g: {
coveralls: require("gulp-coveralls"),
if: require("gulp-if"),
insert: require("gulp-insert"),
istanbul: require("gulp-istanbul"),
mocha: require("gulp-mocha"),

View File

@ -23,19 +23,20 @@ module NpmtsTests {
};
var coveralls = function(){
var stream = plugins.gulp.src("./coverage/**/lcov.info")
.pipe(plugins.g.if(
(process.env.TRAVIS && config.coveralls),
plugins.g.coveralls()
));
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"./coverage/lcov.info")])
.pipe(plugins.g.coveralls());
return stream;
};
istanbul().on("finish",function(){
mocha().on("finish",function(){
coveralls().on("finish",function(){
if(process.env.TRAVIS && config.coveralls){
coveralls().on("finish",function(){
done.resolve(config);
})
} else {
done.resolve(config);
})
}
})
});
return done.promise;