Merge "objectcache: update MemcachedPeclBagOStuff for pecl memcached 3.0.0" into...
[lhc/web/wiklou.git] / Gruntfile.js
index b38bc9a..69a123c 100644 (file)
@@ -13,27 +13,30 @@ module.exports = function ( grunt ) {
        grunt.loadNpmTasks( 'grunt-jsonlint' );
        grunt.loadNpmTasks( 'grunt-karma' );
        grunt.loadNpmTasks( 'grunt-stylelint' );
+       grunt.loadNpmTasks( 'grunt-webdriver' );
 
-       karmaProxy[ wgScriptPath ] = wgServer + wgScriptPath;
+       karmaProxy[ wgScriptPath ] = {
+               target: wgServer + wgScriptPath,
+               changeOrigin: true
+       };
 
        grunt.initConfig( {
                eslint: {
                        all: [
                                '**/*.js',
                                '!docs/**',
-                               '!tests/**',
-                               '!extensions/**',
                                '!node_modules/**',
                                '!resources/lib/**',
                                '!resources/src/jquery.tipsy/**',
                                '!resources/src/jquery/jquery.farbtastic.js',
                                '!resources/src/mediawiki.libs/**',
-                               '!skins/**',
+                               // Third-party code of PHPUnit coverage report
+                               '!tests/coverage/**',
                                '!vendor/**',
+                               // Explicitly say "**/*.js" here in case of symlinks
+                               '!extensions/**/*.js',
+                               '!skins/**/*.js',
                                // Skip functions aren't even parseable
-                               '!resources/src/dom-level2-skip.js',
-                               '!resources/src/es5-skip.js',
-                               '!resources/src/json-skip.js',
                                '!resources/src/mediawiki.hidpi-skip.js'
                        ]
                },
@@ -52,10 +55,7 @@ module.exports = function ( grunt ) {
                        installer: 'includes/installer/i18n/'
                },
                stylelint: {
-                       options: {
-                               syntax: 'less'
-                       },
-                       src: '{resources/src/*,mw-config/**}/*.{css,less}'
+                       src: '{resources/src,mw-config}/**/*.{css,less}'
                },
                watch: {
                        files: [
@@ -76,17 +76,23 @@ module.exports = function ( grunt ) {
                                } ],
                                logLevel: 'DEBUG',
                                frameworks: [ 'qunit' ],
-                               reporters: [ 'progress' ],
+                               reporters: [ 'mocha' ],
                                singleRun: true,
                                autoWatch: false,
                                // Some tests in extensions don't yield for more than the default 10s (T89075)
-                               browserNoActivityTimeout: 60 * 1000
+                               browserNoActivityTimeout: 60 * 1000,
+                               // Karma requires Same-Origin (or CORS) by default since v1.1.1
+                               // for better stacktraces. But we load the first request from wgServer
+                               crossOriginAttribute: false
                        },
                        main: {
                                browsers: [ 'Chrome' ]
                        },
-                       more: {
-                               browsers: [ 'Chrome', 'Firefox' ]
+                       chromium: {
+                               browsers: [ 'Chromium' ]
+                       },
+                       firefox: {
+                               browsers: [ 'Firefox' ]
                        }
                },
                copy: {
@@ -98,7 +104,15 @@ module.exports = function ( grunt ) {
                                        return require( 'path' ).join( dest, src.replace( 'resources/', '' ) );
                                }
                        }
+               },
+
+               // Configure WebdriverIO task
+               webdriver: {
+                       test: {
+                               configFile: './tests/selenium/wdio.conf.js'
+                       }
                }
+
        } );
 
        grunt.registerTask( 'assert-mw-env', function () {