piskel/Gruntfile.js

61 lines
1.5 KiB
JavaScript
Raw Normal View History

2013-05-28 01:57:39 +04:00
/**
* How to run grunt tasks:
* - At project root, run 'npm install' - It will install nodedependencies declared in package,json in <root>/.node_modules
* - install grunt CLI tools globally, run 'npm install -g grunt-cli'
* - run a grunt target defined in Gruntfiles.js, ex: 'grunt lint'
*
* Note: The 'ghost' grunt task have special deps on CasperJS and phantomjs.
* For now, It's configured to run only on TravisCI where these deps are
* correctly defined.
* If you run this task locally, it may require some env set up first.
*/
2013-05-27 02:02:48 +04:00
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
2013-05-28 01:42:16 +04:00
/*options: {
"evil": true,
"asi": true,
"smarttabs": true,
"eqnull": true
},*/
2013-05-27 02:02:48 +04:00
files: [
'Gruntfile.js',
2013-05-27 03:16:41 +04:00
'package.json',
2013-05-28 01:42:16 +04:00
'js/**/*.js',
'!js/lib/**/*.js' // Exclude lib folder (note the leading !)
2013-05-27 02:02:48 +04:00
]
},
connect: {
www: {
options: {
2013-05-27 02:29:40 +04:00
base: '.',
2013-05-27 02:02:48 +04:00
port: 4545
}
}
},
ghost: {
2013-05-27 02:45:22 +04:00
dist: {
filesSrc: ['tests/integration/casperjs/*_test.js'],
options: {
args: {
baseUrl: 'http://localhost:' +
'<%= connect.www.options.port %>/'
},
direct: false,
logLevel: 'error',
printCommand: false,
printFilePaths: true
}
}
2013-05-27 02:02:48 +04:00
}
});
2013-05-27 01:58:59 +04:00
2013-05-27 02:02:48 +04:00
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-ghost');
2013-05-27 01:58:59 +04:00
2013-05-28 01:42:16 +04:00
grunt.registerTask('lint', ['jshint']);
2013-05-27 02:59:24 +04:00
grunt.registerTask('test', ['jshint', 'connect', 'ghost']);
2013-05-27 02:02:48 +04:00
};