Fix a couple of Generic.Files.OneObjectStructurePerFile.MultipleFound in api
[lhc/web/wiklou.git] / Gruntfile.js
index fdbf0ef..fbb93bf 100644 (file)
@@ -8,7 +8,6 @@ module.exports = function ( grunt ) {
 
        grunt.loadNpmTasks( 'grunt-banana-checker' );
        grunt.loadNpmTasks( 'grunt-contrib-copy' );
-       grunt.loadNpmTasks( 'grunt-contrib-watch' );
        grunt.loadNpmTasks( 'grunt-eslint' );
        grunt.loadNpmTasks( 'grunt-jsonlint' );
        grunt.loadNpmTasks( 'grunt-karma' );
@@ -23,7 +22,8 @@ module.exports = function ( grunt ) {
        grunt.initConfig( {
                eslint: {
                        options: {
-                               reportUnusedDisableDirectives: true
+                               reportUnusedDisableDirectives: true,
+                               cache: true
                        },
                        all: [
                                '**/*.js',
@@ -103,6 +103,18 @@ module.exports = function ( grunt ) {
                },
                karma: {
                        options: {
+                               customLaunchers: {
+                                       ChromeCustom: {
+                                               base: 'ChromeHeadless',
+                                               // Chrome requires --no-sandbox in Docker/CI.
+                                               // Newer CI images expose CHROMIUM_FLAGS which sets this (and
+                                               // anything else it might need) automatically. Older CI images,
+                                               // (including Quibble for MW) don't set it yet.
+                                               flags: ( process.env.CHROMIUM_FLAGS ||
+                                                       ( process.env.ZUUL_PROJECT ? '--no-sandbox' : '' )
+                                               ).split( ' ' )
+                                       }
+                               },
                                proxies: karmaProxy,
                                files: [ {
                                        pattern: wgServer + wgScriptPath + '/index.php?title=Special:JavaScriptTest/qunit/export',
@@ -122,13 +134,10 @@ module.exports = function ( grunt ) {
                                crossOriginAttribute: false
                        },
                        main: {
-                               browsers: [ 'Chrome' ]
-                       },
-                       chromium: {
-                               browsers: [ 'Chromium' ]
+                               browsers: [ 'ChromeCustom' ]
                        },
                        firefox: {
-                               browsers: [ 'Firefox' ]
+                               browsers: [ 'FirefoxHeadless' ]
                        }
                },
                copy: {
@@ -159,7 +168,4 @@ module.exports = function ( grunt ) {
        grunt.registerTask( 'minify', 'svgmin' );
        grunt.registerTask( 'lint', [ 'eslint', 'banana', 'stylelint' ] );
        grunt.registerTask( 'qunit', [ 'assert-mw-env', 'karma:main' ] );
-
-       grunt.registerTask( 'test', [ 'lint' ] );
-       grunt.registerTask( 'default', [ 'minify', 'test' ] );
 };