-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit tests and setup coverage report via travis and coveralls
- Loading branch information
Showing
10 changed files
with
437 additions
and
117 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
coverage | ||
.idea | ||
temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- "node" | ||
- "6" | ||
- "5" | ||
- "4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,63 @@ | ||
'use strict'; | ||
var path = require('path'); | ||
var gulp = require('gulp'); | ||
var eslint = require('gulp-eslint'); | ||
var excludeGitignore = require('gulp-exclude-gitignore'); | ||
var mocha = require('gulp-mocha'); | ||
var istanbul = require('gulp-istanbul'); | ||
var nsp = require('gulp-nsp'); | ||
var plumber = require('gulp-plumber'); | ||
var coveralls = require('gulp-coveralls'); | ||
|
||
gulp.task('static', function () { | ||
return gulp.src('**/*.js') | ||
"use strict"; | ||
let path = require("path"); | ||
let gulp = require("gulp"); | ||
let eslint = require("gulp-eslint"); | ||
let excludeGitignore = require("gulp-exclude-gitignore"); | ||
let mocha = require("gulp-mocha"); | ||
let istanbul = require("gulp-istanbul"); | ||
let nsp = require("gulp-nsp"); | ||
let plumber = require("gulp-plumber"); | ||
let coveralls = require("gulp-coveralls"); | ||
|
||
gulp.task("static", function () { | ||
return gulp.src("**/*.js") | ||
.pipe(excludeGitignore()) | ||
.pipe(eslint()) | ||
.pipe(eslint(".eslintrc.json")) | ||
.pipe(eslint.format()) | ||
.pipe(eslint.failAfterError()); | ||
}); | ||
|
||
gulp.task('nsp', function (cb) { | ||
nsp({package: path.resolve('package.json')}, cb); | ||
gulp.task("nsp", function (cb) { | ||
nsp({package: path.resolve("package.json")}, cb); | ||
}); | ||
|
||
gulp.task('pre-test', function () { | ||
return gulp.src('generators/**/*.js') | ||
gulp.task("pre-test", function () { | ||
return gulp.src(["generators/**/*.js", "!**/gulpfile.js"]) | ||
.pipe(excludeGitignore()) | ||
.pipe(istanbul({ | ||
includeUntested: true | ||
})) | ||
.pipe(istanbul.hookRequire()); | ||
}); | ||
|
||
gulp.task('test', ['pre-test'], function (cb) { | ||
var mochaErr; | ||
gulp.task("test", ["pre-test"], function (cb) { | ||
let mochaErr; | ||
|
||
gulp.src('test/**/*.js') | ||
gulp.src("test/**/*.js") | ||
.pipe(plumber()) | ||
.pipe(mocha({reporter: 'spec'})) | ||
.on('error', function (err) { | ||
.pipe(mocha({reporter: "spec"})) | ||
.on("error", function (err) { | ||
mochaErr = err; | ||
}) | ||
.pipe(istanbul.writeReports()) | ||
.on('end', function () { | ||
.on("end", function () { | ||
cb(mochaErr); | ||
}); | ||
}); | ||
|
||
gulp.task('watch', function () { | ||
gulp.watch(['generators/**/*.js', 'test/**'], ['test']); | ||
gulp.task("watch", function () { | ||
gulp.watch(["generators/**/*.js", "test/**"], ["test"]); | ||
}); | ||
|
||
gulp.task('coveralls', ['test'], function () { | ||
gulp.task("coveralls", ["test"], function () { | ||
if (!process.env.CI) { | ||
console.log("Not running on CI server -> skipped coveralls"); | ||
return; | ||
} | ||
|
||
return gulp.src(path.join(__dirname, 'coverage/lcov.info')) | ||
return gulp.src(path.join(__dirname, "coverage/lcov.info")) | ||
.pipe(coveralls()); | ||
}); | ||
|
||
gulp.task('prepublish', ['nsp']); | ||
gulp.task('default', ['static', 'test', 'coveralls']); | ||
gulp.task("prepublish", ["nsp"]); | ||
gulp.task("default", ["static", "test", "coveralls"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,48 @@ | ||
{ | ||
"name": "generator-next", | ||
"version": "0.2.1", | ||
"description": "Generator that provides a basic setup for a Node project with Express and Typescript.", | ||
"homepage": "https://github.com/ommsolutions/generator-next", | ||
"author": { | ||
"name": "Andreas Enenkel", | ||
"email": "[email protected]" | ||
}, | ||
"files": [ | ||
"generators" | ||
], | ||
"main": "generators/index.js", | ||
"keywords": [ | ||
"Node", | ||
"Express", | ||
"Typescript", | ||
"yeoman-generator" | ||
], | ||
"dependencies": { | ||
"chalk": "^1.1.3", | ||
"yeoman-generator": "^1.1.0", | ||
"yosay": "^1.2.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.15.0", | ||
"eslint-config-xo-space": "^0.15.0", | ||
"gulp": "^3.9.1", | ||
"gulp-coveralls": "^0.1.4", | ||
"gulp-eslint": "^3.0.1", | ||
"gulp-exclude-gitignore": "^1.0.0", | ||
"gulp-istanbul": "^1.1.1", | ||
"gulp-line-ending-corrector": "^1.0.1", | ||
"gulp-mocha": "^3.0.1", | ||
"gulp-nsp": "^2.4.2", | ||
"gulp-plumber": "^1.1.0", | ||
"yeoman-assert": "^2.2.3", | ||
"yeoman-test": "^1.6.0" | ||
}, | ||
"eslintConfig": { | ||
"extends": "xo-space", | ||
"env": { | ||
"mocha": true | ||
} | ||
}, | ||
"repository": "https://github.com/ommsolutions/generator-next", | ||
"scripts": { | ||
"prepublish": "gulp prepublish", | ||
"test": "gulp" | ||
}, | ||
"license": "MIT" | ||
"name": "generator-next", | ||
"version": "0.3.0", | ||
"description": "Generator that provides a basic setup for a Node project with Express and Typescript.", | ||
"homepage": "https://github.com/ommsolutions/generator-next", | ||
"author": { | ||
"name": "Andreas Enenkel", | ||
"email": "[email protected]" | ||
}, | ||
"files": [ | ||
"generators" | ||
], | ||
"main": "generators/index.js", | ||
"keywords": [ | ||
"Node", | ||
"Express", | ||
"Typescript", | ||
"yeoman-generator" | ||
], | ||
"dependencies": { | ||
"chalk": "^1.1.3", | ||
"yeoman-generator": "^1.1.0", | ||
"yosay": "^1.2.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.15.0", | ||
"eslint-config-xo-space": "^0.15.0", | ||
"fs-extra": "2.0.0", | ||
"gulp": "^3.9.1", | ||
"gulp-coveralls": "^0.1.4", | ||
"gulp-eslint": "^3.0.1", | ||
"gulp-exclude-gitignore": "^1.0.0", | ||
"gulp-istanbul": "^1.1.1", | ||
"gulp-line-ending-corrector": "^1.0.1", | ||
"gulp-mocha": "^3.0.1", | ||
"gulp-nsp": "^2.4.2", | ||
"gulp-plumber": "^1.1.0", | ||
"rimraf": "2.5.4", | ||
"yeoman-assert": "^2.2.3", | ||
"yeoman-test": "^1.6.0" | ||
}, | ||
"repository": "https://github.com/ommsolutions/generator-next", | ||
"scripts": { | ||
"prepublish": "gulp prepublish", | ||
"test": "gulp" | ||
}, | ||
"license": "MIT" | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.