| 1 | # Contributing to VisualEditor |
| 2 | |
| 3 | Thank you for helping us develop VisualEditor! |
| 4 | |
| 5 | We inherit the contribution guidelines from VisualEditor core. Be sure to read the |
| 6 | [Contribution guidelines](https://gerrit.wikimedia.org/g/VisualEditor/VisualEditor/+/master/CONTRIBUTING.md) |
| 7 | in the VisualEditor repository. |
| 8 | |
| 9 | |
| 10 | ## Running tests |
| 11 | |
| 12 | The VisualEditor plugins for MediaWiki can be tested within your MediaWiki install. |
| 13 | |
| 14 | [Configure your wiki](https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing) to |
| 15 | allow running of tests. In `LocalSettings.php`, set: |
| 16 | ```php |
| 17 | // https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing |
| 18 | $wgEnableJavaScriptTest = true; |
| 19 | ``` |
| 20 | |
| 21 | Then open `http://URL_OF_MEDIAWIKI/index.php/Special:JavaScriptTest/qunit` |
| 22 | (for example, <http://localhost/w/index.php/Special:JavaScriptTest/qunit>). |
| 23 | |
| 24 | Node-based code linting tests can be run locally using npm – run: |
| 25 | |
| 26 | <pre lang="bash"> |
| 27 | npm install && npm test |
| 28 | </pre> |
| 29 | |
| 30 | |
| 31 | ## Pre-commit hook |
| 32 | |
| 33 | A pre-commit git hook script exists which will help flag up any issues and avoid irritating code review steps for you and reviewers. Simply do: |
| 34 | |
| 35 | <pre lang="bash"> |
| 36 | ln -s bin/pre-commit.sh ../.git/hooks/pre-commit |
| 37 | </pre> |