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' );
},
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',
crossOriginAttribute: false
},
main: {
- browsers: [ 'Chrome' ]
- },
- chromium: {
- browsers: [ 'Chromium' ]
+ browsers: [ 'ChromeCustom' ]
},
firefox: {
- browsers: [ 'Firefox' ]
+ browsers: [ 'FirefoxHeadless' ]
}
},
copy: {
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' ] );
};