-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from radify/docs
Add unit tests and documentation
- Loading branch information
Showing
21 changed files
with
1,309 additions
and
22,846 deletions.
There are no files selected for viewing
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,8 @@ | ||
languages: | ||
JavaScript: true | ||
exclude_paths: | ||
- "lib/*" | ||
- "config/*" | ||
- "spec/*" | ||
- "Gulpfile.js" | ||
- "sample-project/*" |
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,22 @@ | ||
# This file is for unifying the coding style for different editors and IDEs. | ||
# More information at http://EditorConfig.org | ||
# The site includes a list of editors that support EditorConfig by | ||
# default and also lists plugins for editors that do not. | ||
|
||
# root = true tells the text editor to honor the .editorconfig file | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_size = 2 | ||
indent_style = space | ||
# tab_width defaults to the value of indent_size | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.php] | ||
indent_size = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
node_modules | ||
**/node_modules | ||
sample-project/angular-scaffold.js | ||
build/ | ||
coverage/ |
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,14 @@ | ||
{ | ||
"maxerr" : 50, | ||
"camelcase" : true, | ||
"indent" : 2, | ||
"latedef" : true, | ||
"newcap" : true, | ||
"noempty" : true, | ||
"quotmark" : "single", | ||
"undef" : true, | ||
"strict" : true, | ||
"phantom" : true, | ||
"browser" : true, | ||
"globals" : {} | ||
} |
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,21 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "0.11" | ||
- "0.12" | ||
- "4.0" | ||
- "4.1" | ||
- "4.2" | ||
|
||
before_script: | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- npm install | ||
|
||
script: | ||
- gulp | ||
|
||
addons: | ||
code_climate: | ||
repo_token: | ||
secure: "mTBue2hOpHjHgvgLqAkrQ56FMKAF+N2ux/Dt8uVaNHA3nSBJE8+M1TmKcWZtZQY4owZzOb5hNFOsyGfICjrJN462Y1gYewm5Vtful2LSbQa9wl7xFdQPce7CEmHJ47dVwOMf7vjxsatM6ThuM70ofo4rfpiusrJ4UbH2EafopbQ=" |
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 was deleted.
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'); | ||
var Server = require('karma').Server; | ||
var coveralls = require('gulp-coveralls'); | ||
var jshint = require('gulp-jshint'); | ||
var nsp = require('gulp-nsp'); | ||
var runSequence = require('run-sequence'); | ||
var istanbul = require('gulp-istanbul'); | ||
|
||
/* | ||
* PLEASE NOTE: run-sequence is a | ||
* temporary solution until the release of | ||
* Gulp 4.0, which contains run-sequence's | ||
* functionality. | ||
*/ | ||
|
||
var paths = { | ||
'spec': 'spec/**/*.js', | ||
'src': 'src/**/*.js' | ||
}; | ||
|
||
gulp.task('ngdocs', [], function () { | ||
var gulpDocs = require('gulp-ngdocs'); | ||
return gulp.src(paths.src) | ||
.pipe(gulpDocs.process({ | ||
html5Mode: false, | ||
startPage: '/api', | ||
title: 'angular-scaffold' | ||
})) | ||
.pipe(gulp.dest('./build/docs')); | ||
}); | ||
|
||
gulp.task('test', function(done) { | ||
new Server({ | ||
configFile: __dirname + '/config/karma.conf.js', | ||
singleRun: true | ||
}, done).start(); | ||
}); | ||
|
||
gulp.task('coveralls', function() { | ||
gulp.src('coverage/**/lcov.info') | ||
.pipe(coveralls()); | ||
}); | ||
|
||
// Task that calculates the unit test coverage for the module | ||
gulp.task('coverage', function(cb) { | ||
new Server({ | ||
configFile: __dirname + '/config/karma.conf.js', | ||
singleRun: true, | ||
reporters: ['progress', 'coverage'], | ||
|
||
preprocessors: { | ||
'src/**/*.js':['coverage'] | ||
}, | ||
|
||
// optionally, configure the reporter | ||
coverageReporter: { | ||
reporters: [ | ||
{ | ||
type : 'html', | ||
dir : 'build/coverage/' | ||
}, | ||
{ | ||
type: 'text' | ||
} | ||
] | ||
} | ||
}, cb).start(); | ||
}); | ||
|
||
gulp.task('lint', function() { | ||
return gulp.src([paths.src]) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('default')) | ||
.pipe(jshint.reporter('fail')); | ||
}); | ||
|
||
gulp.task('security', function(cb) { | ||
nsp({ | ||
package: __dirname + '/package.json', | ||
stopOnError: true | ||
}, cb); | ||
}); | ||
|
||
gulp.task('default', function(cb) { | ||
runSequence('test', ['lint', 'coveralls', 'security'], cb); | ||
}); |
Oops, something went wrong.