Testing pre-commit hook

This commit is contained in:
jdescottes 2013-08-11 13:37:23 +02:00
parent 2e3ddd6ed1
commit fd2907cfde

View File

@ -11,6 +11,25 @@
*/ */
module.exports = function(grunt) { module.exports = function(grunt) {
var piskelScripts = require('./piskel-script-list.js').scripts;
var getGhostConfig = function (delay) {
return {
filesSrc : ['tests/integration/casperjs/*_test.js'],
options : {
args : {
baseUrl : 'http://localhost:' + '<%= connect.www.options.port %>/',
mode : '?debug',
delay : delay
},
direct : false,
logLevel : 'info',
printCommand : false,
printFilePaths : true
}
};
};
grunt.initConfig({ grunt.initConfig({
jshint: { jshint: {
/*options: { /*options: {
@ -38,30 +57,20 @@ module.exports = function(grunt) {
www : { www : {
options : { options : {
base : '.', base : '.',
port : 4545 port : 7357
} }
} }
}, },
ghost : { ghost : {
dist : { default : getGhostConfig(3000),
filesSrc : ['tests/integration/casperjs/*_test.js'], local : getGhostConfig(50)
options : {
args : {
baseUrl : 'http://localhost:' + '<%= connect.www.options.port %>/'
},
direct : false,
logLevel : 'debug',
printCommand : false,
printFilePaths : true
}
}
}, },
concat : { concat : {
options : { options : {
separator : ';', separator : ';',
}, },
dist : { dist : {
src : require('./piskel-script-list.js').scripts, src : piskelScripts,
dest : 'build/piskel-packaged.js', dest : 'build/piskel-packaged.js',
}, },
}, },
@ -93,7 +102,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-leading-indent'); grunt.loadNpmTasks('grunt-leading-indent');
grunt.registerTask('lint', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint']); grunt.registerTask('lint', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint']);
grunt.registerTask('test', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect', 'ghost']); grunt.registerTask('test', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect', 'ghost:default']);
grunt.registerTask('precommit', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect', 'ghost:local']);
grunt.registerTask('default', ['jshint', 'concat', 'uglify']); grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
}; };