Skip to content

Commit 2be6eaf

Browse files
committedMar 26, 2015
Merge pull request #27 from cjihrig/master
Add documentation for global settings
2 parents 5902b5b + 1151896 commit 2be6eaf

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
 

‎README.md

+22
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Lead Maintainer - [Colin Ihrig](https://github.com/cjihrig)
5050
- [`throw([type], [message])`](#throwtype-message)
5151
- [`count()`](#count)
5252
- [`incomplete()`](#incomplete)
53+
- [Settings](#settings)
54+
- [`truncateMessages`](#truncatemessages)
5355

5456
## Example
5557

@@ -653,3 +655,23 @@ var expect = Code.expect;
653655
expect(5).to.not.be.a.string;
654656
console.log(Code.incomplete()); // -> [ 'readme.js:345:1' ]
655657
```
658+
659+
### Settings
660+
661+
**code** can be configured using the module's `settings` object. The following
662+
settings are supported:
663+
664+
#### `truncateMessages`
665+
666+
A Boolean value that, when `true`, causes long assertion error messages to be
667+
truncated for readability. Setting this to `false` causes the entire message
668+
to be displayed. Defaults to `true`.
669+
670+
```js
671+
var Code = require('code');
672+
var expect = Code.expect;
673+
var foo = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
674+
675+
Code.settings.truncateMessages = false;
676+
expect(foo).to.deep.equal([]);
677+
```

0 commit comments

Comments
 (0)
Please sign in to comment.