rEPAR/js/tests986c1e787088master
tests
README
Please see the Parsoid project page for some information on how to get started with these tests and the current parser architecture.
Install dependencies and run tests:
$ cd .. # if you are in this README file's directory $ npm test
Running parserTests.js
For parserTests, you also need MediaWiki's parser test cases (parserTests.txt). 'npm test' from the modules directory automatically fetches the current version to this directory. You can also specify a test case file as an argument. You can also symlink parserTests.txt from a core git checkout.
$ node ./parserTests.js
Several options are available for parserTests:
$ node ./parserTests.js --help
Enjoy!
Running the round-trip test server
In 'js/tests/server/', to install the necessary packages, run $ npm install
You'll need a pre-created MySQL database. Then, copy server.settings.js.example to server.settings.js and in that file edit the connection parameters. You can also override the settings with command line options, to see them and their default values run $ node server --help
To populate the database with initial data, run
$ mysql [connection parameters] < sql/create_everything.mysql $ node importJson --prefix=en titles.example.en.json $ node importJson --prefix=es titles.example.es.json
The script importJson.js takes the same connection parameters as server.js. To test the handling of non-existent articles, you might want to also do:
$ node importJson --prefix=en titles.example.bogus.json $ node importJson --prefix=es titles.example.bogus.json
Now start the server:
$ node server
Running the round-trip test clients
In js/tests/client, copy config.example.js to config.js and edit it to your taste. In separate windows, as many as you want:
$ node js/tests/client/client.js
Then take a look at the statistics.