Merge "Add tests for API's assert={user|bot}"
[lhc/web/wiklou.git] / tests / frontend / Gruntfile.js
1 /*!
2 * Grunt file
3 */
4
5 /*jshint node:true */
6 module.exports = function ( grunt ) {
7 grunt.loadNpmTasks( 'grunt-contrib-jshint' );
8 grunt.loadNpmTasks( 'grunt-contrib-watch' );
9 grunt.loadNpmTasks( 'grunt-banana-checker' );
10 grunt.loadNpmTasks( 'grunt-jscs-checker' );
11 grunt.loadNpmTasks( 'grunt-jsonlint' );
12
13 grunt.file.setBase( __dirname + '/../..' );
14
15 grunt.initConfig( {
16 pkg: grunt.file.readJSON( __dirname + '/package.json' ),
17 jshint: {
18 options: {
19 jshintrc: true
20 },
21 all: [
22 '*.js',
23 '{includes,languages,resources,skins,tests}/**/*.js'
24 ]
25 },
26 jscs: {
27 all: [
28 '<%= jshint.all %>',
29 // Auto-generated file with JSON (double quotes)
30 '!tests/qunit/data/mediawiki.jqueryMsg.data.js'
31
32 // Exclude all files ignored by jshint
33 ].concat( grunt.file.read( '.jshintignore' ).split( '\n' ).reduce( function ( patterns, pattern ) {
34 // Filter out empty lines
35 if ( pattern.length && pattern[0] !== '#' ) {
36 patterns.push( '!' + pattern );
37 }
38 return patterns;
39 }, [] ) )
40 },
41 jsonlint: {
42 all: [
43 '.jscsrc',
44 '{languages,languages,maintenance,resources}/**/*.json',
45 'tests/frontend/package.json'
46 ]
47 },
48 banana: {
49 core: 'languages/i18n/',
50 installer: 'includes/installer/i18n/'
51 },
52 watch: {
53 files: [
54 '<%= jscs.all %>',
55 '<%= jsonlint.all %>',
56 '.jshintignore',
57 '.jshintrc'
58 ],
59 tasks: 'test'
60 }
61 } );
62
63 grunt.registerTask( 'lint', ['jshint', 'jscs', 'jsonlint', 'banana'] );
64 grunt.registerTask( 'test', ['lint'] );
65 grunt.registerTask( 'default', ['test'] );
66 };