Merge commit '65c3d1bf3868ad3e1caec9fc77021735df53f989' into issue-711

This commit is contained in:
laf
2015-04-13 15:48:29 +01:00
22 changed files with 3643 additions and 1665 deletions

View File

@@ -24,11 +24,12 @@ module.exports = function (grunt) {
jshint: {
all: [
'Gruntfile.js', 'src/js/*.js'
'Gruntfile.js', 'src/js/*.js', 'test/*.js'
],
options: {
'browser' : true,
'node' : true,
'jquery' : true,
'boss' : false,
'curly' : true,
'debug' : false,
@@ -57,15 +58,24 @@ module.exports = function (grunt) {
'quotmark' : 'single',
'globals': {
'define': false,
'jQuery': false,
'moment': false
'moment': false,
// Jasmine
'jasmine': false,
'describe': false,
'xdescribe': false,
'expect': false,
'it': false,
'xit': false,
'spyOn': false,
'beforeEach': false,
'afterEach': false
}
}
},
jscs: {
all: [
'Gruntfile.js', 'src/js/*.js'
'Gruntfile.js', 'src/js/*.js', 'test/*.js'
],
options: {
config: '.jscs.json'
@@ -86,22 +96,49 @@ module.exports = function (grunt) {
'build/css/bootstrap-datetimepicker.css': 'src/less/bootstrap-datetimepicker-build.less'
}
}
},
jasmine: {
customTemplate: {
src: 'src/js/*.js',
options: {
specs: 'test/*Spec.js',
helpers: 'test/*Helper.js',
styles: [
'node_modules/bootstrap/dist/css/bootstrap.min.css',
'build/css/bootstrap-datetimepicker.min.css'
],
vendor: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/moment/min/moment-with-locales.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js'
],
display: 'none',
summary: 'true'
}
}
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-jasmine');
// These plugins provide necessary tasks.
require('load-grunt-tasks')(grunt);
// Default task.
grunt.registerTask('default', ['jshint', 'jscs']);
grunt.registerTask('default', ['jshint', 'jscs', 'less', 'jasmine']);
// travis build task
grunt.registerTask('build:travis', [
// code style
'jshint', 'jscs'
'jshint', 'jscs',
// build
'uglify', 'less',
// tests
'jasmine'
]);
// Task to be run when building
@@ -131,7 +168,7 @@ module.exports = function (grunt) {
done();
});
}
else {
else { //--target=css
grunt.util.spawn({
cmd: 'src/nuget/nuget.exe',
args: [
@@ -152,4 +189,6 @@ module.exports = function (grunt) {
});
}
});
grunt.registerTask('test', ['jshint', 'jscs', 'uglify', 'less', 'jasmine']);
};