Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
📝 add validBlock/validElem info
Browse files Browse the repository at this point in the history
  • Loading branch information
mistadikay committed Nov 27, 2015
1 parent 80da52f commit 422e8a4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,41 @@ chai.use(chaiBEM({

### Block

* __block__ method
* __validBlock__ property

Examples:

```js
// you can check plain classNames
expect('input input_focused').to.be.a.block('input');

// or DOM elements themselves
expect(document.getElementById('someInput')).to.be.a.block('input');

// 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_focused').to.be.a.validBlock;
```

### Element

* __elem__ method
* __validElem__ property

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

// you can just check if it's a valid element at all
expect('input__control').to.be.a.validElem;

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

### Modificator
Expand Down

0 comments on commit 422e8a4

Please sign in to comment.