<commit_before>A demo setup for unit testing client-side JavaScript code with [Mocha.js](http://visionmedia.github.io/mocha/) and [Chai.js](http://chaijs.com/).

Since mocha 1.2, you can install mocha via Node and run mocha init <path> to generate a client side testing skeleton inside the directory at <path>.<commit_msg>Updated README to mention Karma.<commit_after>A demo setup for unit testing client-side JavaScript code with [Mocha.js](http://visionmedia.github.io/mocha/) and [Chai.js](http://chaijs.com/).

Since mocha 1.2, you can install mocha via Node and run mocha init <path> to generate a client side testing skeleton inside the directory at <path>.

This sample also includes a [Karma](http://karma-runner.github.io/) configuration to run the tests automatically.

To use Karma, you need to have [node.js](http://nodejs.org) and [npm](https://npmjs.org/) installed. In the project directory, type `npm install karma-mocha`. After the karma install is finished, type `node_modules/.bin/karma start` and navigate to `http://localhost:9876` to let Karma capture the web browser and run the tests automatically.
{'fraction_non_alphanumeric': 0.10606060606060606, 'fraction_numerical': 0.0071301247771836, 'mean_word_length': 4.671717171717172, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, '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': '3034181', 'n_tokens_mistral': 331, 'n_tokens_neox': 314, 'n_words': 137}