fixed api tests
This commit is contained in:
parent
d0d273a718
commit
b2b09171f3
48
gruntfile.js
48
gruntfile.js
|
@ -1,4 +1,4 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var bowerArray = ['public/lib/angular/angular.min.js',
|
var bowerArray = ['public/lib/angular/angular.min.js',
|
||||||
'public/lib/angular-scroll/angular-scroll.min.js',
|
'public/lib/angular-scroll/angular-scroll.min.js',
|
||||||
|
@ -205,50 +205,22 @@ module.exports = function(grunt) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mocha_istanbul: {
|
mocha_istanbul: {
|
||||||
coverage: {
|
|
||||||
src: watchFiles.allTests, // a folder works nicely
|
|
||||||
options: {
|
|
||||||
mask: '*.test.js',
|
|
||||||
require: ['server.js']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
coverageClient: {
|
|
||||||
src: watchFiles.clientTests, // specifying file patterns works as well
|
|
||||||
options: {
|
|
||||||
coverageFolder: 'coverageClient',
|
|
||||||
mask: '*.test.js',
|
|
||||||
require: ['server.js']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
coverageServer: {
|
coverageServer: {
|
||||||
src: watchFiles.serverTests,
|
src: watchFiles.serverTests,
|
||||||
options: {
|
options: {
|
||||||
coverageFolder: 'coverageServer',
|
coverageFolder: 'coverageServer',
|
||||||
mask: '*.test.js',
|
mask: '*.test.js',
|
||||||
require: ['server.js']
|
require: ['server.js'],
|
||||||
}
|
|
||||||
},
|
|
||||||
coveralls: {
|
|
||||||
src: watchFiles.allTests, // multiple folders also works
|
|
||||||
options: {
|
|
||||||
require: ['server.js'],
|
|
||||||
coverage: true, // this will make the grunt.event.on('coverage') event listener to be triggered
|
|
||||||
root: './lib', // define where the cover task should consider the root of libraries that are covered by tests
|
|
||||||
reportFormats: ['cobertura','lcovonly']
|
reportFormats: ['cobertura','lcovonly']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
istanbul_check_coverage: {
|
lcovMerge: {
|
||||||
default: {
|
options: {
|
||||||
options: {
|
emitters: ['event'],
|
||||||
coverageFolder: 'coverage*', // will check both coverage folders and merge the coverage results
|
},
|
||||||
check: {
|
src: ['./coverageServer/*.info', './clientCoverage/lcov-report/*.info']
|
||||||
lines: 80,
|
},
|
||||||
statements: 80
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
html2js: {
|
html2js: {
|
||||||
options: {
|
options: {
|
||||||
base: 'public',
|
base: 'public',
|
||||||
|
@ -311,9 +283,7 @@ module.exports = function(grunt) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Code coverage tasks.
|
// Code coverage tasks.
|
||||||
grunt.registerTask('coveralls', ['env:test','mocha_istanbul:coveralls']);
|
grunt.registerTask('coveralls', ['env:test','lcovMerge']);
|
||||||
grunt.registerTask('coverage', ['env:test', 'mocha_istanbul:coverage']);
|
|
||||||
grunt.registerTask('coverage:client', ['env:test', 'mocha_istanbul:coverageClient']);
|
|
||||||
grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']);
|
grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']);
|
||||||
|
|
||||||
// Default task(s).
|
// Default task(s).
|
||||||
|
|
|
@ -29,11 +29,20 @@ module.exports = function(config) {
|
||||||
'public/modules/**/views/**/*.html': ['ng-html2js'],
|
'public/modules/**/views/**/*.html': ['ng-html2js'],
|
||||||
'public/modules/**/views/*.html': ['ng-html2js'],
|
'public/modules/**/views/*.html': ['ng-html2js'],
|
||||||
'public/form_modules/forms/base/views/**/*.html': ['ng-html2js'],
|
'public/form_modules/forms/base/views/**/*.html': ['ng-html2js'],
|
||||||
'public/form_modules/forms/base/views/*.html': ['ng-html2js']
|
'public/form_modules/forms/base/views/*.html': ['ng-html2js'],
|
||||||
//'public/modules/*/*.js': ['coverage'],
|
'public/modules/*/*.js': ['coverage'],
|
||||||
//'public/modules/*/*[!tests]*/*.js': ['coverage'],
|
'public/modules/*/*[!tests]*/*.js': ['coverage']
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// configure coverage reporter
|
||||||
|
coverageReporter: {
|
||||||
|
reporters: [
|
||||||
|
{ type: 'html', subdir: 'report-html' },
|
||||||
|
{ type: 'lcov', subdir: 'report-lcov' },
|
||||||
|
],
|
||||||
|
dir : 'coverageClient/'
|
||||||
|
},
|
||||||
|
|
||||||
ngHtml2JsPreprocessor: {
|
ngHtml2JsPreprocessor: {
|
||||||
stripPrefix: 'public/',
|
stripPrefix: 'public/',
|
||||||
prependPrefix: 'static/',
|
prependPrefix: 'static/',
|
||||||
|
|
|
@ -94,6 +94,7 @@
|
||||||
"grunt-execute": "^0.2.2",
|
"grunt-execute": "^0.2.2",
|
||||||
"grunt-i18nlint": "github:jwarby/grunt-i18nlint",
|
"grunt-i18nlint": "github:jwarby/grunt-i18nlint",
|
||||||
"grunt-karma": "~0.12.1",
|
"grunt-karma": "~0.12.1",
|
||||||
|
"grunt-lcov-merge": "^1.2.3",
|
||||||
"grunt-mocha-istanbul": "^3.0.1",
|
"grunt-mocha-istanbul": "^3.0.1",
|
||||||
"grunt-mocha-test": "~0.12.1",
|
"grunt-mocha-test": "~0.12.1",
|
||||||
"grunt-newer": "~1.1.1",
|
"grunt-newer": "~1.1.1",
|
||||||
|
|
Loading…
Reference in a new issue