mediawiki-extensions-Cite/Gruntfile.js
Andrew Kostka 626d9d4188 Add first browser test
This adds a test which checks if the extension appears on the
Special:Version page.

This is an initial step for adding more browser tests to check
changes done in I26fe41c328157233cc5b06d38d2ba0f7b036a853

Change-Id: I9a9d1cd2a25277f2c430f4e80b51b72c1621f91b
2018-11-19 16:08:42 +00:00

85 lines
1.5 KiB
JavaScript

/*!
* Grunt file
*
* @package Cite
*/
/* eslint-env node, es6 */
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-svgmin' );
grunt.initConfig( {
eslint: {
all: [
'**/*.js',
'{.jsduck,build}/**/*.js',
'modules/**/*.js',
'tests/**/*.js',
'!node_modules/**',
'!vendor/**'
]
},
banana: conf.MessagesDirs,
stylelint: {
all: [
'**/*.css',
'**/*.less',
'!node_modules/**',
'!vendor/**'
]
},
jsonlint: {
all: [
'**/*.json',
'!node_modules/**',
'!vendor/**'
]
},
// SVG Optimization
svgmin: {
options: {
js2svg: {
pretty: true,
multipass: true
},
plugins: [ {
cleanupIDs: false
}, {
removeDesc: false
}, {
removeRasterImages: true
}, {
removeTitle: false
}, {
removeViewBox: false
}, {
removeXMLProcInst: false
}, {
sortAttrs: true
} ]
},
all: {
files: [ {
expand: true,
cwd: 'modules/ve-cite/icons',
src: [
'**/*.svg'
],
dest: 'modules/ve-cite/icons/',
ext: '.svg'
} ]
}
}
} );
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'jsonlint', 'banana', 'svgmin' ] );
grunt.registerTask( 'default', 'test' );
};