Skip to content

Commit

Permalink
Merge pull request #868 from deeperx/auto-register-expect-side-effect
Browse files Browse the repository at this point in the history
Add script that registers expect as a side-effect
  • Loading branch information
keithamus committed Nov 17, 2016
2 parents 8a2ef67 + 4a19d5a commit 2a30721
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,28 @@ var expect = chai.expect;
var should = chai.should();
```

## Native Modules Usage

```js
import assert from 'chai/assert'
// Using Assert style
import expect from 'chai/expect'
// Using Expect style
import should from 'chai/should'
// Using Should style
```

## Usage with Mocha

```bash
mocha spec.js -r chai/assert # OR:
# Using Assert style
mocha spec.js -r chai/expect # OR:
# Using Expect style
mocha spec.js -r chai/should
# Using Should style
```

[Read more about these styles in our docs](http://chaijs.com/guide/styles/).

## Plugins
Expand Down
1 change: 1 addition & 0 deletions assert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global.assert = module.exports = require('./').assert;
1 change: 1 addition & 0 deletions expect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global.expect = module.exports = require('./').expect;
2 changes: 1 addition & 1 deletion should.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./').should();
global.should = module.exports = require('./').should();

0 comments on commit 2a30721

Please sign in to comment.