Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script that registers expect as a side-effect #868

Merged
merged 6 commits into from
Nov 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();