We should have tests for the JavaScript module to make sure that it works as expected. This has two steps: setting up the extension for tests and writing some first tests.
Setting up testing
Based on the manual on JavaScript testing, tests can be set up by doing the following:
- Create tests/qunit/ext.chessViewer.core.test.js and see the extension examples file for how it should look
- Register the tests by adding the following code to extension.json
"QUnitTestModule": {
"localBasePath": "tests/qunit/",
"remoteExtPath": "ChessBrowser/tests/qunit/",
"scripts": [
"ext.chessViewer.core.test.js"
],
"dependencies": [
ext.chessViewer.core.js"
]
},Writing tests
- See the extension examples file for examples on how to write tests
- Follow the MediaWiki QUnit guidelines
- Check out the QUnit guides for more information
Patch checklist
A successful first patch will cover at least the following core functions: