<commit_before>Ember-cli-blanket
=========

[Blanket](http://blanketjs.org/) based code coverage for ember-cli applications

## Installation

Install the addon:
```sh
ember install:addon ember-cli-blanket
```

## Reporters

ember-cli-blanket can output coverage data to a file.

Two reporters are currently supported:

- json - provides summary and file level statistics 
- lcov - provides a basic lcov formatted file

Reporters have default output destinations and this can be overwritten in the `blanket-options.js` file.

```js
var options = {
...
    cliOptions: {
      jsonOptions: {
        outputFile: 'test-output.json' // default is 'coverage.json'
      },
      lcovOptions: {
        outputFile: 'lcov.dat'
      },
      reporters: ['json']
    }
  };
```

Only a single reporter is supported currently.

Append ```?coverage``` to the HTML report URL to enable coverage. This option will enable the creation of the coverage data file when running within a continuous integration context. This value can be specified within the testem.json:
 
```js
{
...
  'test_page': 'tests/index.html?coverage',
...
}
```

### Limitations of reporters

It should be noted that given the multitude of transformations that the javascript under test goes through that the output of the `lcov` reporter in particular will not match line for line the original input source.

In fact, there is current no direct mapping between the `es6` module names in the lcov output and the original input files.

## Usage

Run `ember server`, navigate to the application url [/tests](http://localhost:4200/tests) (e.g. localhost:4200/tests) and select the "Enable coverage" checkbox.

A options file is available in tests/blanket-options.js that contains the current regex for data coverage (filter) the regex for exclusion from data coverage (antifilter) and an array of string to exclude from blanket's requirejs loader (loaderExclusions).

As of release 0.2.4 loader exclusions are no longer necessary to fix conflicts with addon modules.  Loader exclusions may still be used to remove data coverage for specific files (e.g. config/environment).

## License

MIT

## Release History

* 0.5.0

Thanks to monumental effort from @jschilli the project now supports reporters and headless test runs.  Additionally, unit tests are now in place with continuous integration and the code base is much cleaner.  Amazing work Jeff!

* 0.4.0

Upgraded to ember-cli 0.2.2 @jschilli

* 0.3.4

Once again, <NAME> keeps the project moving, this time annotating files that weren't instrumented in the extended requirejs loading.

* 0.3.3

Thanks again to <NAME>, modules off the standard ember-cli require paths are now included in the coverage if the modules are included as imports.  For example, this means that utility function modules will now be included in the coverage.

* 0.3.2
 
Thanks to <NAME> code coverage can be enabled/disabled in tests/blanket-options.js via the enableCoverage property.  This allows instrumentation to be turned off so that code debugging line numbers will line up.

For QUnit testing, turning off the 'Enable Coverage' flag in the HTML report will disable instrumentation.

For Mocha testing, appending ?coverage in the HTML report url will enable coverage, absence of this query parameter will disable coverage.

* 0.3.1

New installations will exclude templates from coverage by default.  If you wish to include templates in your coverage reports, modify tests/blanket-options.js to remove 'template' from the antifilter.
<commit_msg>Add config file location to README<commit_after>Ember-cli-blanket
=========

[Blanket](http://blanketjs.org/) based code coverage for ember-cli applications

## Installation

Install the addon:
```sh
ember install:addon ember-cli-blanket
```

## Reporters

ember-cli-blanket can output coverage data to a file.

Two reporters are currently supported:

- json - provides summary and file level statistics
- lcov - provides a basic lcov formatted file

Reporters have default output destinations and this can be overwritten in the `blanket-options.js` file, which is auto-installed in your `tests` folder.

```js
var options = {
...
    cliOptions: {
      jsonOptions: {
        outputFile: 'test-output.json' // default is 'coverage.json'
      },
      lcovOptions: {
        outputFile: 'lcov.dat'
      },
      reporters: ['json']
    }
  };
```

Only a single reporter is supported currently.

Append ```?coverage``` to the HTML report URL to enable coverage. This option will enable the creation of the coverage data file when running within a continuous integration context. This value can be specified within the testem.json:

```js
{
...
  'test_page': 'tests/index.html?coverage',
...
}
```

### Limitations of reporters

It should be noted that given the multitude of transformations that the javascript under test goes through that the output of the `lcov` reporter in particular will not match line for line the original input source.

In fact, there is current no direct mapping between the `es6` module names in the lcov output and the original input files.

## Usage

Run `ember server`, navigate to the application url [/tests](http://localhost:4200/tests) (e.g. localhost:4200/tests) and select the "Enable coverage" checkbox.

A options file is available in tests/blanket-options.js that contains the current regex for data coverage (filter) the regex for exclusion from data coverage (antifilter) and an array of string to exclude from blanket's requirejs loader (loaderExclusions).

As of release 0.2.4 loader exclusions are no longer necessary to fix conflicts with addon modules.  Loader exclusions may still be used to remove data coverage for specific files (e.g. config/environment).

## License

MIT

## Release History

* 0.5.0

Thanks to monumental effort from @jschilli the project now supports reporters and headless test runs.  Additionally, unit tests are now in place with continuous integration and the code base is much cleaner.  Amazing work Jeff!

* 0.4.0

Upgraded to ember-cli 0.2.2 @jschilli

* 0.3.4

Once again, <NAME> keeps the project moving, this time annotating files that weren't instrumented in the extended requirejs loading.

* 0.3.3

Thanks again to <NAME>, modules off the standard ember-cli require paths are now included in the coverage if the modules are included as imports.  For example, this means that utility function modules will now be included in the coverage.

* 0.3.2

Thanks to <NAME> code coverage can be enabled/disabled in tests/blanket-options.js via the enableCoverage property.  This allows instrumentation to be turned off so that code debugging line numbers will line up.

For QUnit testing, turning off the 'Enable Coverage' flag in the HTML report will disable instrumentation.

For Mocha testing, appending ?coverage in the HTML report url will enable coverage, absence of this query parameter will disable coverage.

* 0.3.1

New installations will exclude templates from coverage by default.  If you wish to include templates in your coverage reports, modify tests/blanket-options.js to remove 'template' from the antifilter.

{'fraction_non_alphanumeric': 0.07080884410859221, 'fraction_numerical': 0.009235936188077247, 'mean_word_length': 4.065201984408221, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '1288019', 'n_tokens_mistral': 1939, 'n_tokens_neox': 1845, 'n_words': 946}