<commit_before>Chai assertions for BEM class names
---

[![npm](https://img.shields.io/npm/v/chai-bem.svg?style=flat-square)](https://www.npmjs.com/package/chai-bem)
[![travis](http://img.shields.io/travis/mistadikay/chai-bem.svg?style=flat-square)](https://travis-ci.org/mistadikay/chai-bem)
[![coverage](http://img.shields.io/coveralls/mistadikay/chai-bem/master.svg?style=flat-square)](https://coveralls.io/r/mistadikay/chai-bem)
[![deps](http://img.shields.io/david/mistadikay/chai-bem.svg?style=flat-square)](https://david-dm.org/mistadikay/chai-bem)

## Install
```
npm i chai-bem
```

## Usage

Plug-in the plugin first:
```js
import chai from 'chai';
import chaiBEM from 'chai-bem';

chai.use(chaiBEM());
```

You can set optional BEM naming rules (default values and available options are the same as in [bem-naming](https://github.com/bem/bem-naming#custom-naming-convention)), for example:
```js
chai.use(chaiBEM({
    elem: '-',
    mod: '--',
    wordPattern: '[a-zA-Z0-9]+'
}));
```

Both classNames and DOM elements are supported:

```js
expect('input input_focused').to.be.a.block('input');
expect(document.getElementById('someInput')).to.be.a.block('input');
```

### Block

* `__block__` method
* `__validBlock__` property

Examples:

```js
// check if it's an `input` block
expect('input input_focused').to.be.a.block('input');

// or you can just check if it's a valid block at all
expect('input input_focused').to.be.a.validBlock;

// this will throw an error
expect('input__control').to.be.a.validBlock;
```

### Element

* `__elem__` method
* `__validElem__` property

```js
expect('input__control').to.be.an.elem({
    block: 'input',
    elem: 'control'
});

// is it a valid element at all
expect('input__control').to.be.a.validElem;

// this will throw an error
expect('input').to.be.a.validElem;
```

### Modificators

* `__mods__` method
<commit_msg>:pencil: typo fixes<commit_after>Chai assertions for BEM class names
---

[![npm](https://img.shields.io/npm/v/chai-bem.svg?style=flat-square)](https://www.npmjs.com/package/chai-bem)
[![travis](http://img.shields.io/travis/mistadikay/chai-bem.svg?style=flat-square)](https://travis-ci.org/mistadikay/chai-bem)
[![coverage](http://img.shields.io/coveralls/mistadikay/chai-bem/master.svg?style=flat-square)](https://coveralls.io/r/mistadikay/chai-bem)
[![deps](http://img.shields.io/david/mistadikay/chai-bem.svg?style=flat-square)](https://david-dm.org/mistadikay/chai-bem)

## Install
```
npm i chai-bem
```

## Usage

Plug-in the plugin first:
```js
import chai from 'chai';
import chaiBEM from 'chai-bem';

chai.use(chaiBEM());
```

You can set optional BEM naming rules (default values and available options are the same as in [bem-naming](https://github.com/bem/bem-naming#custom-naming-convention)), for example:
```js
chai.use(chaiBEM({
    elem: '-',
    mod: '--',
    wordPattern: '[a-zA-Z0-9]+'
}));
```

Both classNames and DOM elements are supported:

```js
expect('input input_focused').to.be.a.block('input');
expect(document.getElementById('someInput')).to.be.a.block('input');
```

### Block

* `block` method
* `validBlock` property

Examples:

```js
// check if it's an `input` block
expect('input input_focused').to.be.a.block('input');

// or you can just check if it's a valid block at all
expect('input input_focused').to.be.a.validBlock;

// this will throw an error
expect('input__control').to.be.a.validBlock;
```

### Element

* `elem` method
* `validElem` property

```js
expect('input__control').to.be.an.elem({
    block: 'input',
    elem: 'control'
});

// is it a valid element at all
expect('input__control').to.be.a.validElem;

// this will throw an error
expect('input').to.be.a.validElem;
```

### Modificators

* `mods` method

{'fraction_non_alphanumeric': 0.1971153846153846, 'fraction_numerical': 0.0010683760683760685, 'mean_word_length': 4.614692653673163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, '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': '271359', 'n_tokens_mistral': 1499, 'n_tokens_neox': 1419, 'n_words': 260}