X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=Gruntfile.js;h=573db69afb15a591d42bff5cd4e354562b8eb3df;hb=295d35a9d40922bfc020d9e8374ca0eae69d8713;hp=a292d0b377552179650de926530b5d880dc915a7;hpb=dbbb71b47a8afaed0331a947d4c2e66a512ed36f;p=lhc%2Fweb%2Fwiklou.git diff --git a/Gruntfile.js b/Gruntfile.js index a292d0b377..573db69afb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -76,7 +76,9 @@ module.exports = function ( grunt ) { frameworks: [ 'qunit' ], reporters: [ 'dots' ], singleRun: true, - autoWatch: false + autoWatch: false, + // Some tests in extensions don't yield for more than the default 10s (T89075) + browserNoActivityTimeout: 60 * 1000 }, main: { browsers: [ 'Chrome' ] @@ -97,8 +99,21 @@ module.exports = function ( grunt ) { } } ); + grunt.registerTask( 'assert-mw-env', function () { + if ( !process.env.MW_SERVER ) { + grunt.log.error( 'Environment variable MW_SERVER must be set.\n' + + 'Set this like $wgServer, e.g. "http://localhost"' + ); + } + if ( !process.env.MW_SCRIPT_PATH ) { + grunt.log.error( 'Environment variable MW_SCRIPT_PATH must be set.\n' + + 'Set this like $wgScriptPath, e.g. "/w"'); + } + return !!( process.env.MW_SERVER && process.env.MW_SCRIPT_PATH ); + } ); + grunt.registerTask( 'lint', ['jshint', 'jscs', 'jsonlint', 'banana'] ); - grunt.registerTask( 'qunit', 'karma:main' ); + grunt.registerTask( 'qunit', [ 'assert-mw-env', 'karma:main' ] ); grunt.registerTask( 'test', ['lint'] ); grunt.registerTask( 'default', 'test' );