fixed api tests
This commit is contained in:
parent
d0d273a718
commit
b2b09171f3
42
gruntfile.js
42
gruntfile.js
|
@ -1,4 +1,4 @@
|
|||
'use strict';
|
||||
|
||||
|
||||
var bowerArray = ['public/lib/angular/angular.min.js',
|
||||
'public/lib/angular-scroll/angular-scroll.min.js',
|
||||
|
@ -205,49 +205,21 @@ module.exports = function(grunt) {
|
|||
}
|
||||
},
|
||||
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: {
|
||||
src: watchFiles.serverTests,
|
||||
options: {
|
||||
coverageFolder: 'coverageServer',
|
||||
mask: '*.test.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']
|
||||
}
|
||||
}
|
||||
},
|
||||
istanbul_check_coverage: {
|
||||
default: {
|
||||
lcovMerge: {
|
||||
options: {
|
||||
coverageFolder: 'coverage*', // will check both coverage folders and merge the coverage results
|
||||
check: {
|
||||
lines: 80,
|
||||
statements: 80
|
||||
}
|
||||
}
|
||||
}
|
||||
emitters: ['event'],
|
||||
},
|
||||
src: ['./coverageServer/*.info', './clientCoverage/lcov-report/*.info']
|
||||
},
|
||||
html2js: {
|
||||
options: {
|
||||
|
@ -311,9 +283,7 @@ module.exports = function(grunt) {
|
|||
});
|
||||
|
||||
// Code coverage tasks.
|
||||
grunt.registerTask('coveralls', ['env:test','mocha_istanbul:coveralls']);
|
||||
grunt.registerTask('coverage', ['env:test', 'mocha_istanbul:coverage']);
|
||||
grunt.registerTask('coverage:client', ['env:test', 'mocha_istanbul:coverageClient']);
|
||||
grunt.registerTask('coveralls', ['env:test','lcovMerge']);
|
||||
grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']);
|
||||
|
||||
// Default task(s).
|
||||
|
|
|
@ -29,9 +29,18 @@ module.exports = function(config) {
|
|||
'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/modules/*/*.js': ['coverage'],
|
||||
//'public/modules/*/*[!tests]*/*.js': ['coverage'],
|
||||
'public/form_modules/forms/base/views/*.html': ['ng-html2js'],
|
||||
'public/modules/*/*.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: {
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
"grunt-execute": "^0.2.2",
|
||||
"grunt-i18nlint": "github:jwarby/grunt-i18nlint",
|
||||
"grunt-karma": "~0.12.1",
|
||||
"grunt-lcov-merge": "^1.2.3",
|
||||
"grunt-mocha-istanbul": "^3.0.1",
|
||||
"grunt-mocha-test": "~0.12.1",
|
||||
"grunt-newer": "~1.1.1",
|
||||
|
|
Loading…
Reference in a new issue