Skip to content

Commit 084655f

Browse files
committed
Merge pull request #117 from callumlocke/patch-1
Document new ES6 import style
2 parents cb4ab70 + afd890c commit 084655f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

_guides/styles.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,23 @@ quick helpers to keep you out of trouble when using `should`.
158158
- `should.Throw`
159159
- `should.not.Throw`
160160

161+
### Using Should in ES2015
162+
163+
It isn't possible to chain a function call from an ES2015 `import`
164+
statement – it has to go on its own line, which looks a little
165+
verbose:
166+
167+
```js
168+
import chai from 'chai';
169+
chai.should();
170+
```
171+
172+
For a cleaner look, you can do this instead:
173+
174+
```js
175+
import 'chai/should';
176+
```
177+
161178
## Configuration
162179

163180
### config.includeStack

0 commit comments

Comments
 (0)