Skip to content

Commit

Permalink
style(readme): 🎨 update readme icons
Browse files Browse the repository at this point in the history
Make icons in Readme.md better reflect related content
  • Loading branch information
kopach committed Nov 18, 2020
1 parent bf76965 commit a6f7a0c
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,52 +29,52 @@

</h1>

## Table of Contents
## πŸ“– Table of Contents

- [❓ Why?](#-why-)
- [✨ Features](#-features-)
- [πŸ’Ύ Install](#-install-)
- [πŸ‘½ API](#-api-)
- [πŸ”¨ Usage](#-usage-)
- [πŸŽ›οΈ API](#️-api-)
- [🀹 Usage](#-usage-)
- [`include` as array of strings](#include-as-array-of-strings-)
- [`include` as string](#include-as-string-)
- [karma `plugins` section](#karma-plugins-section-)
- [πŸ“„ License](#-license-)

## ❓ Why? [πŸ”](#table-of-contents)
## ❓ Why? [πŸ”](#-table-of-contents)

With `karma`, to test source code – you need to include only `*.spec.(ts|js)` files into test config. Then those spec files will import corresponding source code files. This leads to an issue with "fake" test coverage, as if some source code file would be omitted by all `*.spec.(ts|js))` files – this source code file won't be shown in coverage report at all.

`karma-sabarivka-reporter` plugin fixes described issue by going through all the source files and including them explicitly into coverage result.

Plugin works with both: TypeScript (`*.ts`) and JavaScript (`*.js`) files

## ✨ Features [πŸ”](#table-of-contents)
## ✨ Features [πŸ”](#-table-of-contents)

- Both [karma-coverage-istanbul-reporter](https://www.npmjs.com/package/karma-coverage-istanbul-reporter) and [karma-coverage](https://www.npmjs.com/package/karma-coverage) supported
- Both JavaScript `*.js` and TypeScript `*.ts` files support
- Multiple patterns
- Negated patterns: ['foo*', '!foobar']

## πŸ’Ύ Install [πŸ”](#table-of-contents)
## πŸ’Ύ Install [πŸ”](#-table-of-contents)

With [npm](https://npmjs.org/) installed, run

```bash
npm install --save-dev karma-sabarivka-reporter
```

## πŸ‘½ API [πŸ”](#table-of-contents)
## πŸŽ›οΈ API [πŸ”](#-table-of-contents)

`@param {string[] | string} coverageReporter.include` - Glob pattern, `string` or `array of strings`. Files which should be included into the coverage result.

## πŸ”¨ Usage [πŸ”](#table-of-contents)
## 🀹 Usage [πŸ”](#-table-of-contents)

**Important Note:** if used with [karma-coverage](https://www.npmjs.com/package/karma-coverage), `'sabarivka'` should go before `'coverage'` in `reporters` list

Update `karma.conf.js`

### `include` as array of strings [πŸ”](#table-of-contents)
### `include` as array of strings [πŸ”](#-table-of-contents)

```JavaScript
reporters: [
Expand All @@ -98,7 +98,7 @@ coverageReporter: {

Same result may be achieved with more complex one line glob pattern

### `include` as string [πŸ”](#table-of-contents)
### `include` as string [πŸ”](#-table-of-contents)

```JavaScript
reporters: [
Expand All @@ -112,13 +112,14 @@ coverageReporter: {
},
```

### karma `plugins` section [πŸ”](#table-of-contents)
### karma `plugins` section [πŸ”](#-table-of-contents)

If your karma config has `plugins` section, add also `karma-sabarivka-reporter` there, otherwise β€” no action is required.

Karma's documentation:

> By default, Karma loads all sibling NPM modules which have a name starting with karma-\*.\
You can also explicitly list plugins you want to load via the `plugins` configuration setting. The configuration value can either be a string (module name), which will be required by Karma, or an object (inlined plugin).
> You can also explicitly list plugins you want to load via the `plugins` configuration setting. The configuration value can either be a string (module name), which will be required by Karma, or an object (inlined plugin).
[See here more info on how karma plugins loading works](https://karma-runner.github.io/4.0/config/plugins.html)

Expand All @@ -130,6 +131,6 @@ plugins: [
],
```

## πŸ“„ License [πŸ”](#table-of-contents)
## πŸ“„ License [πŸ”](#-table-of-contents)

This software is licensed under the [MIT](https://github.com/kopach/karma-sabarivka-reporter/blob/master/LICENSE)

0 comments on commit a6f7a0c

Please sign in to comment.