X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=Gruntfile.js;h=f3950f6f505f836e42fd3495b525259e7efa9c2e;hb=3f264a4f62f25deac6f19123702b9054ce7e03d7;hp=fdbf0efbc5106fe0d423b8caf2e45841fe97bca7;hpb=5659c8bc4d176de4a5c312894652958a2bdd51ed;p=lhc%2Fweb%2Fwiklou.git diff --git a/Gruntfile.js b/Gruntfile.js index fdbf0efbc5..f3950f6f50 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,9 +8,7 @@ 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' ); grunt.loadNpmTasks( 'grunt-stylelint' ); grunt.loadNpmTasks( 'grunt-svgmin' ); @@ -23,10 +21,12 @@ module.exports = function ( grunt ) { grunt.initConfig( { eslint: { options: { - reportUnusedDisableDirectives: true + reportUnusedDisableDirectives: true, + extensions: [ '.js', '.json' ], + cache: true }, all: [ - '**/*.js', + '**/*.js{,on}', '!docs/**', '!node_modules/**', '!resources/lib/**', @@ -36,18 +36,13 @@ module.exports = function ( grunt ) { '!tests/coverage/**', '!vendor/**', // Explicitly say "**/*.js" here in case of symlinks - '!extensions/**/*.js', - '!skins/**/*.js' - ] - }, - jsonlint: { - all: [ - '**/*.json', - '!{docs/js,extensions,node_modules,skins,vendor}/**' + '!extensions/**/*.js{,on}', + '!skins/**/*.js{,on}' ] }, banana: { options: { + requireLowerCase: false, disallowBlankTranslations: false }, core: 'languages/i18n/', @@ -103,6 +98,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 +129,10 @@ module.exports = function ( grunt ) { crossOriginAttribute: false }, main: { - browsers: [ 'Chrome' ] - }, - chromium: { - browsers: [ 'Chromium' ] + browsers: [ 'ChromeCustom' ] }, firefox: { - browsers: [ 'Firefox' ] + browsers: [ 'FirefoxHeadless' ] } }, copy: { @@ -159,7 +163,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' ] ); };