<commit_before># mocha-reporter-vscode

*A mocha reporter for displaying test results as build failures and warnings in VSCode*

Outputs results from mocha in a way that's easy to consume using VSCode's problem matchers. Includes searching into stack traces and source files to find line and column numbers where possible.

**Install**

```
npm install --save-dev https://github.com/franklin-ross/mocha-reporter-vscode
```

**Add to mocha command as reporter**

```
mocha --reporter mocha-reporter-vscode
```

**Run using a VSCode task**

Assuming there is an npm script named "test" which runs mocha with this reporter.

```
//tasks.json
{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "0.1.0",
  "command": "npm",
  "args": ["run"],
  "isShellCommand": true,
  "tasks": [
    {
      "taskName": "test",
      "showOutput": "never",
      "problemMatcher": {
        "owner": "mocha",
        "fileLocation": [ "absolute" ],
        "pattern": {
            "regexp": "^\\s*([^\\(]+)\\((\\d+,\\d+)\\):\\s*(error|warning|info):\\s*(.*)$",
            "file": 1,
            "location": 2,
            "severity": 3,
            "message": 4
        }
      }<commit_msg>Add syntax highlight to readme.<commit_after># mocha-reporter-vscode

*A mocha reporter for displaying test results as build failures and warnings in VSCode*

Outputs results from mocha in a way that's easy to consume using VSCode's problem matchers. Includes searching into stack traces and source files to find line and column numbers where possible.

**Install**

```
npm install --save-dev https://github.com/franklin-ross/mocha-reporter-vscode
```

**Add to mocha command as reporter**

```
mocha --reporter mocha-reporter-vscode
```

**Run using a VSCode task**

Assuming there is an npm script named "test" which runs mocha with this reporter.

```json
//tasks.json
{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "0.1.0",
  "command": "npm",
  "args": ["run"],
  "isShellCommand": true,
  "tasks": [
    {
      "taskName": "test",
      "showOutput": "never",
      "problemMatcher": {
        "owner": "mocha",
        "fileLocation": [ "absolute" ],
        "pattern": {
            "regexp": "^\\s*([^\\(]+)\\((\\d+,\\d+)\\):\\s*(error|warning|info):\\s*(.*)$",
            "file": 1,
            "location": 2,
            "severity": 3,
            "message": 4
        }
      }
{'fraction_non_alphanumeric': 0.16626984126984126, 'fraction_numerical': 0.010317460317460317, 'mean_word_length': 2.785285285285285, 'pattern_counts': {'":': 32, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '1385943', 'n_tokens_mistral': 857, 'n_tokens_neox': 799, 'n_words': 243}