<commit_before>Mocha Tests
===========

## Getting started

1. Install `grunt-mocha`

```
npm install grunt-mocha
```

Note: be careful not to use the `-g` option, or your paths might get confused.

2. Run the tests in `<src_root>` (where `Gruntfile.js` is).

To run them all:

```
grunt mocha
```

To run tests for `<app_name>`:

```
grunt mocha:<app_name>
```

You can also visit the tests from the browser `http://localhost:8000/mocha/<app>/<config>`


## Adding a new app to test

There are three steps to adding a new app to test:

  1. Add the app name to the `Gruntfile.js` file. Note: the app has to correspond to an actual Django app.
  2. Create a mocha template in `corehq/apps/<app>/templates/<app>/spec/mocha.html` to run tests. See an example on [here](https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/app_manager/templates/app_manager/spec/mocha.html).
  3. Create tests that are included in the template in `corehq/apps/<app>/static/<app>/spec/`<commit_msg>Revert "update mocha docs"<commit_after>Mocha Tests
===========

## Adding a new app to test

There are three steps to adding a new app to test:

  1. Add the app name to the `Gruntfile.js` file. Note: the app has to correspond to an actual Django app.
  2. Create a mocha template in `corehq/apps/<app>/templates/<app>/spec/mocha.html` to run tests. See an example on [here](https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/app_manager/templates/app_manager/spec/mocha.html).
  3. Create tests that are included in the template in `corehq/apps/<app>/static/<app>/spec/`
{'fraction_non_alphanumeric': 0.13639260675589548, 'fraction_numerical': 0.0076481835564053535, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '2944747', 'n_tokens_mistral': 560, 'n_tokens_neox': 527, 'n_words': 187}