jenkins-bot has submitted this change and it was merged.
Change subject: Add support for npm tests
......................................................................
Add support for npm tests
Run jshint and jsonlint tests through npm.
Disable banana checker due to missing messages in documentation.
Will re enable banana in a follow up patch.
Change-Id: Idc71cdd65cda36bc3639eec63a08532108a55c96
---
M .gitignore
M .jshintignore
M .jshintrc
A Gruntfile.js
A package.json
5 files changed, 53 insertions(+), 2 deletions(-)
Approvals:
Siebrand: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.gitignore b/.gitignore
index 115b5cd..e71d5dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
-.svn
*~
.*.swp
*.kate-swp
@@ -12,3 +11,4 @@
composer.lock
extensions/
vendor/
+node_modules/
diff --git a/.jshintignore b/.jshintignore
index 6fe22a3..e7bc219 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -1,3 +1,5 @@
+node_modules/
+
# upstream libs
resources/js/jquery.autosize.js
resources/js/jquery.ui.position.js
diff --git a/.jshintrc b/.jshintrc
index d7649a3..ce29904 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -16,7 +16,7 @@
"bitwise": true,
"forin": false,
"regexp": false,
- "strict": true,
+ "strict": false,
"laxbreak": true,
"smarttabs": true,
"multistr": true,
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..4436d52
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,37 @@
+/*jshint node:true */
+module.exports = function ( grunt ) {
+ grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+ grunt.loadNpmTasks( 'grunt-jsonlint' );
+ grunt.loadNpmTasks( 'grunt-banana-checker' );
+
+ grunt.initConfig( {
+ jshint: {
+ options: {
+ jshintrc: true
+ },
+ all: [
+ '**/*.js',
+ '!node_modules/**'
+ ]
+ },
+ /* banana: {
+ all: [
+ 'i18n/api',
+ 'i18n/core',
+ 'i18n/pagetranslation',
+ 'i18n/sandbox',
+ 'i18n/search'
+ ]
+ },
+ */
+ jsonlint: {
+ all: [
+ '**/*.json',
+ '!node_modules/**'
+ ]
+ }
+ } );
+
+ grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
+ grunt.registerTask( 'default', 'test' );
+};
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..e0061f2
--- /dev/null
+++ b/package.json
@@ -0,0 +1,12 @@
+{
+ "private": true,
+ "scripts": {
+ "test": "grunt test"
+ },
+ "devDependencies": {
+ "grunt": "0.4.5",
+ "grunt-cli": "0.1.13",
+ "grunt-contrib-jshint": "0.11.3",
+ "grunt-jsonlint": "1.0.5"
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/250700
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idc71cdd65cda36bc3639eec63a08532108a55c96
Gerrit-PatchSet: 11
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits