<commit_before># Unit Tests

Unit tests are automatically performed using [busted](http://olivinelabs.com/busted/). It depends on `luarocks`.

To grab busted, install the same version [as used in the automated tests](https://github.com/koreader/koreader/blob/master/.ci/install.sh). At the time of writing that is 2.0.rc12-1:
```bash
mkdir $HOME/.luarocks
cp /etc/luarocks/config.lua $HOME/.luarocks/config.lua
echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua
luarocks --local install busted 2.0.rc12-1
```
Then you can set up the environment variables with `./kodev activate`.

If all went well, you'll now be able to run `./kodev test front` (for the frontend) or `./kodev test base` (for koreader-base).<commit_msg>[doc] Update busted version mentioned in docs (#9078)<commit_after># Unit Tests

Unit tests are automatically performed using [busted](http://olivinelabs.com/busted/). It depends on `luarocks`.

To grab busted, install the same version [as used in the automated tests](https://github.com/koreader/koreader/blob/master/.ci/install.sh). At the time of writing that is 2.0.0-1:
```bash
mkdir $HOME/.luarocks
cp /etc/luarocks/config.lua $HOME/.luarocks/config.lua
echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua
luarocks --local install busted 2.0.0-1
```
Then you can set up the environment variables with `./kodev activate`.

If all went well, you'll now be able to run `./kodev test front` (for the frontend) or `./kodev test base` (for koreader-base).
{'fraction_non_alphanumeric': 0.12901069518716576, 'fraction_numerical': 0.014705882352941176, 'mean_word_length': 4.27112676056338, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2833704', 'n_tokens_mistral': 512, 'n_tokens_neox': 487, 'n_words': 172}